PrimeNG version 5.0.2.
I see this is fixed in PrimeNG 8+
When using on page tablecolresizedemo.html from demo website:
Code: Select all
<div class="content-section implementation">
<h3 class="first">Fit Mode</h3>
<p-table [columns]="cols" [value]="cars1"
[resizableColumns]="true"
[rows]="5"
[paginator]="true"
[rowsPerPageOptions]="[5,10,20]">
<ng-template pTemplate="header" let-columns>
<tr>
<th *ngFor="let col of columns" pResizableColumn>
{{col.header}}
</th>
</tr>
</ng-template>
<ng-template pTemplate="body" let-rowData let-columns="columns">
<tr>
<td *ngFor="let col of columns" class="ui-resizable-column">
{{rowData[col.field]}}
</td>
</tr>
</ng-template>
</p-table>