/
githubmirror
/
components
Обзор
Документация
Войти
/
githubmirror
/
components
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
main
src/components-examples/material/table/table-virtual-scroll/table-virtual-scroll-example.html
37 строк
2 KB
Kristiyan Kostadinov
docs: add virtual scrolling examples
09 дек 2025, 20:37
09 дек 2025, 20:37
b85e5f5
Код
Авторство
О чём код?
<p>Showing {{dataSource.length}} rows</p> <!-- Enable virtual scrolling --> <cdk-virtual-scroll-viewport class="example-container" [itemSize]="52" [maxBufferPx]="1200" [minBufferPx]="400"> <table mat-table [dataSource]="dataSource" [trackBy]="trackBy"> <!-- Position Column --> <ng-container matColumnDef="position"> <th mat-header-cell *matHeaderCellDef> No. </th> <td mat-cell *matCellDef="let element"> {{element.position}} </td> <th mat-footer-cell *matFooterCellDef> No. </th> </ng-container> <!-- Name Column --> <ng-container matColumnDef="name"> <th mat-header-cell *matHeaderCellDef> Name </th> <td mat-cell *matCellDef="let element"> {{element.name}} </td> <th mat-footer-cell *matFooterCellDef> Name </th> </ng-container> <!-- Weight Column --> <ng-container matColumnDef="weight"> <th mat-header-cell *matHeaderCellDef> Weight </th> <td mat-cell *matCellDef="let element"> {{element.weight}} </td> <th mat-footer-cell *matFooterCellDef> Weight </th> </ng-container> <!-- Symbol Column --> <ng-container matColumnDef="symbol"> <th mat-header-cell *matHeaderCellDef> Symbol </th> <td mat-cell *matCellDef="let element"> {{element.symbol}} </td> <th mat-footer-cell *matFooterCellDef> Symbol </th> </ng-container> <tr mat-header-row *matHeaderRowDef="displayedColumns; sticky: true"></tr> <tr mat-row *matRowDef="let row; columns: displayedColumns;"></tr> </table> </cdk-virtual-scroll-viewport>