【发布时间】:2020-07-28 22:45:02
【问题描述】:
我正在使用 Angular Material 表。
我可以将列对齐设置为右对齐。
HTML:
<table mat-table [dataSource]="dataSource">
...
<ng-container matColumnDef="position">
<th mat-header-cell *matHeaderCellDef> No. </th>
...
CSS:
.mat-column-position {
text-align: right;
}
但是当我使用排序功能时,列标题不再向右对齐:
<table mat-table [dataSource]="dataSource" matSort>
...
<ng-container matColumnDef="position">
<th mat-header-cell *matHeaderCellDef mat-sort-header> No. </th>
...
我猜问题出在“排序”符号上。
有什么想法吗?
【问题讨论】:
标签: angular sorting header angular-material