I have created an HTML table which will generate infinite columns based on the number of rows in the input data. I've tried to use this SO post as an example, but I'm struggling to convert my HTML to Angular Material design. Any suggestions?
Since Angular material tables are column-based (and I couldn't find a way to iterate over the rows within them) I got stuck pretty quickly.
I couldn't get angular material tables working in the StackBlitz, so here is a copy paste of my code:
<table mat-table [dataSource]="newLicenseDS">
<ng-container *ngFor="let disCol of newLicCol; let idx = index" matColumnDef="{{disCol}}">
<th mat-header-cell *matHeaderCellDef>{{disCol}}</th>
<ng-container *ngIf="idx==0">
<td mat-cell *matCellDef="let e">{{e[0]|json}}</td>
</ng-container>
<ng-container *ngIf="idx==1">
<td mat-cell *matCellDef="let e">{{e[1]|json}}</td>
</ng-container>
<ng-container *ngIf="idx==2">
<td mat-cell *matCellDef="let e[2]">{{e|json}}</td>
</ng-container>
</ng-container>
<tr mat-header-row *matHeaderRowDef="newLicCol"></tr>
<tr mat-row *matRowDef="let row; columns: newLicCol"></tr>
</table>