Reputation: 428
I am using Nz-Zorro ie; ng-antd to design table. Here I am dynamically calling the table header.
I have 4 columns and I want reduce the width of 2 columns by its name. How can I do that ?
<thead>
<tr>
<th *ngFor="let column of listOfColumns">
{{ column.name }}
</th>
</tr>
</thead>
Upvotes: 2
Views: 4567
Reputation: 700
you can add a colWidth: "string"
property to each of your listOfColumns
item's class and change it in your model with your model key. then use [nzWidth]
to change the column width:
<thead>
<tr>
<th *ngFor="let column of listOfColumns" [nzWidth]="column.colWidth">
{{ column.name }}
</th>
</tr>
</thead>
Upvotes: 2