In the first column I would set buttons for different actions for each row but I have no idea how to define the first column as static one.
Code: Select all
<p-table [columns]="cols" [value]="cars">
<ng-template pTemplate="header" let-columns>
<tr>
<!--
<th>
Action
</th>
-->
<th *ngFor="let col of columns">
{{col.header}}
</th>
</tr>
</ng-template>
<ng-template pTemplate="body" let-rowData let-columns="columns">
<tr>
<!--
<td>
<button>...
</td>
-->
<td *ngFor="let col of columns">
{{rowData[col.field]}}
</td>
</tr>
</ng-template>
</p-table>