大表的角度虚拟滚动

时间:2019-04-19 17:23:45

标签: angular scroll angular-material large-data

我有一个表,其中将包含大量的行和列,并且当我使用其中一个表时,都不会呈现任何内容:

这是我的桌子

<table class="table text-center ">
    <thead>
        <tr>
            <th class="border  " ></th>

            <th *ngFor="let d of destinations" class="border-right border-top-0">
                    {{d}}
            </th>
        </tr>
    </thead>
    <tbody >

      <cdk-virtual-scroll-viewport itemSize="5">
        <tr *ngFor="let o of origins">

            <th  class="border-right border-left   ">
                    {{o}}
            </th>
            <td *cdkVirtualFor="let d of destinations" class="border-right hover ">
                <!--Content-->
            </td>
        </tr>
      </cdk-virtual-scroll-viewport>
    </tbody>
</table>

我还对表应用了某种样式,以便仅固定将滚动的正文以及标题和第一列。我已经尝试过仅可视化行,并且没有呈现任何内容。我也希望虚拟化水平滚动。

所以知道怎么做吗?

0 个答案:

没有答案