/
githubmirror
/
components
Обзор
Документация
Войти
/
githubmirror
/
components
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
main
src/components-examples/material/table/table-expandable-rows/table-expandable-rows-example.html
52 строки
2 KB
Kristiyan Kostadinov
docs: use proper shadow classes in examples (#33494)
06 июл 2026, 11:10
Не верифицирован
06 июл 2026, 11:10
76f5be0
Код
Авторство
О чём код?
<table mat-table [dataSource]="dataSource" multiTemplateDataRows class="mat-shadow-2"> @for (column of columnsToDisplay; track column) { <ng-container matColumnDef="{{column}}"> <th mat-header-cell *matHeaderCellDef>{{column}}</th> <td mat-cell *matCellDef="let element">{{element[column]}}</td> </ng-container> } <ng-container matColumnDef="expand"> <th mat-header-cell *matHeaderCellDef aria-label="row actions"> </th> <td mat-cell *matCellDef="let element"> <button matIconButton aria-label="expand row" (click)="toggle(element); $event.stopPropagation()" class="example-toggle-button" [class.example-toggle-button-expanded]="isExpanded(element)"> <mat-icon>keyboard_arrow_down</mat-icon> </button> </td> </ng-container> <!-- Expanded Content Column - The detail row is made up of this one column that spans across all columns --> <ng-container matColumnDef="expandedDetail"> <td mat-cell *matCellDef="let element" [attr.colspan]="columnsToDisplayWithExpand.length"> <div class="example-element-detail-wrapper" [class.example-element-detail-wrapper-expanded]="isExpanded(element)"> <div class="example-element-detail"> <div class="example-element-diagram"> <div class="example-element-position">{{element.position}}</div> <div class="example-element-symbol">{{element.symbol}}</div> <div class="example-element-name">{{element.name}}</div> <div class="example-element-weight">{{element.weight}}</div> </div> <div class="example-element-description"> {{element.description}} <span class="example-element-description-attribution"> -- Wikipedia </span> </div> </div> </div> </td> </ng-container> <tr mat-header-row *matHeaderRowDef="columnsToDisplayWithExpand"></tr> <tr mat-row *matRowDef="let element; columns: columnsToDisplayWithExpand;" class="example-element-row" [class.example-expanded-row]="isExpanded(element)" (click)="toggle(element)"> </tr> <tr mat-row *matRowDef="let row; columns: ['expandedDetail']" class="example-detail-row"></tr> </table>