Hi I am looking to achieve following structure on material table. So far I have seen some examples but I'm not able to achieve this
What I want to achieve:
| | |
|--------|-------|
| header | value |
| header | value |
| header | value |
<table >
<tbody><tr>
<th>name</th>
<td>
value
</td>
</tr>
<tr>
<th>name2</th>
<td>
value2
</td>
</tr>
</tbody>
</table>
when I do this implementation I'm only getting the result below:
<mat-table #table [dataSource]="dataSource" matSort>
<ng-container matColumnDef="{{key}}" *ngFor="let key of objectKeys(dataSource)">
<mat-header-cell *matHeaderCellDef mat-sort-header> {{getData(key).toUpperCase()}} </mat-header-cell>
<mat-cell *matCellDef="let element"> {{element[key]}} </mat-cell>
</ng-container>
<mat-header-row *matHeaderRowDef="displayedColumns"></mat-header-row>
<mat-row *matRowDef="let row; columns: displayedColumns;"></mat-row>
</mat-table>
This is the result:
| header | header | header | Header | header |
|--------|--------|--------|--------|--------|
| | | | | |
| | | | | |
| | | | | |
any help is Appreciated !