I have mat-table in which columns get created dynamically
I want to add a expand column functionality using [attr.colspan]
if a click event is detected on a column header the attr gets applied on that specific column
inserting it in the HTML template applies the change to the first column
<ng-container
matColumnDef="{{ column }}"
*ngFor="let column of displayedColumns">
<th mat-header-cell *matHeaderCellDef (click)="headerEvent(column)">{{ column }}</th>
<td mat-cell *matCellDef="let element"
[attr.colspan]="1"
>{{ element[column] }}</td>
</ng-container>
How can I apply the [attr.colspan] dynamically ?