【发布时间】:2019-08-02 17:55:33
【问题描述】:
我正在尝试将表格中的一个标题对齐。我试过了:
.header-align-right {
display: flex;
justify-content: flex-end;
}
在一个类中并将其添加到mat-header-cell。这使文本正确对齐,但也为元素添加了奇怪的间距,使其与其余标题不对齐。在没有display:flex 的情况下也尝试过,但没有任何效果。
<ng-container matColumnDef="Number">
<th mat-header-cell *matHeaderCellDef mat-sort-header class="header-align-right">Number</th>
<td mat-cell *matCellDef="let row" align="right">{{row.Number}}</td>
<td mat-footer-cell *matFooterCellDef></td>
</ng-conIainer>
如您所见,我将单元格的内容对齐,我也想对齐标题。
【问题讨论】:
-
请使用代码 sn-p 发布您的 HTML 和 CSS 以及到目前为止您尝试过的内容。
标签: css angular angular-material