0

How to change the width of the columns in dynamic table as it divided automatically based on the number of the columns

<mat-table #table [dataSource]="dataSource" matSort > 
<ng-container *ngFor="let disCol of displayedColumns; let colIndex = index" matColumnDef="{{disCol}}">
  <mat-header-cell *matHeaderCellDef mat-sort-header
    style="font-size: 15px; font-family: Arial, Helvetica, sans-serif; font-weight: 900;">
    {{tableHeaderCaptions[colIndex] | titlecase}}
  </mat-header-cell>
  <mat-cell *matCellDef="let element "> {{element[disCol]}}
  </mat-cell>
</ng-container>

<mat-header-row *matHeaderRowDef="displayedColumns"></mat-header-row>
<mat-row *matRowDef="let row; columns: displayedColumns;" (click)="OnSelect(row)"></mat-row>

0 Answers0