我正在使用 Nz-Zorro ie; ng-antd 设计表。这里我动态调用表头。
我有 4 列,我想通过名称减少 2 列的宽度。我怎样才能做到这一点?
<thead>
<tr>
<th *ngFor="let column of listOfColumns">
{{ column.name }}
</th>
</tr>
</thead>
最佳答案
您可以将 colWidth: "string"
属性添加到每个 listOfColumns
项的类中,并使用模型键在模型中更改它。然后使用[nzWidth]
更改列宽:
<thead>
<tr>
<th *ngFor="let column of listOfColumns" [nzWidth]="column.colWidth">
{{ column.name }}
</th>
</tr>
</thead>
关于angular - 调整Nz-Table动态列中某些列的宽度,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/68757275/