Reputation: 1313
is there any way how to set different width for column ?
After many tries, it seems columns are even, ignoring all styles.
Upvotes: 5
Views: 14846
Reputation: 483
yes, it is possible using css .mat-column-<matColumnDef-value>
, suppose you have a column def "group" like:
<!-- Group Column -->
<ng-container matColumnDef="group">
<mat-header-cell *matHeaderCellDef mat-sort-header>Group</mat-header-cell>
<mat-cell *matCellDef="let element">
{{element.group}}
</mat-cell>
</ng-container>
In the css you can set the width:
.mat-column-group {
width: 150px;
max-width: 150px;
}
Upvotes: 8
Reputation: 1313
this is awkward, it is not possible to override styles by width
... min-width
has to be applied.
Upvotes: 0