【发布时间】:2021-01-28 20:38:29
【问题描述】:
我在this 页面上使用材料mat-table 创建了一个基本列表,并且它可以正常工作。但是,当尝试将操作列移动到如下所示表格的末尾列时,第一列的顺序保持不变,这没有任何意义。
<!-- I move this just below the tr tags -->
<!-- action column -->
<ng-container *ngIf="rowActionIcon?.length" [matColumnDef]="rowActionIcon">
<th mat-header-cell *matHeaderCellDef></th>
<td mat-cell *matCellDef="let element" [id]="rowActionIcon" (click)="emitRowAction(element)">
<button mat-button>
<mat-icon>remove_shopping_cart</mat-icon>
</button>
</td>
</ng-container>
<tr mat-header-row *matHeaderRowDef="displayedColumns"></tr>
<tr mat-row *matRowDef="let row; columns: displayedColumns;"></tr>
</table>
我还想在 Actions 列中创建 3 个图标作为表格的最后一列。有解决问题的想法吗?
【问题讨论】:
标签: angular angular-material material-design mat-table