I have a dynamic table using mat-table where i render the columns from the data object.
<table #myTable mat-table [dataSource]="dataSource" class="mat-elevation-z8">...
I render the columns
<ng-container matColumnDef="id">
<th mat-header-cell *matHeaderCellDef>id</th>
<td mat-cell *matCellDef="let element"> {{element.id}} </td>
</ng-container>
...
<tr mat-header-row *matHeaderRowDef="displayedColumns"></tr>
<tr mat-row *matRowDef="let row; columns: displayedColumns;"></tr>
I want to add a static row in the end of the table data where i want to show some sum values from the mat-table columns.
I can provide this row name in the array like: private displayedColumns: string[] = ['id', 'column1', 'column2', 'column3', 'sum']; Where id and other column names are present in my object and mapped accordingly but how can i add this static sum row ?