Code: Select all
<p-table #dt [value]="items" [paginator]="true" [rows]="20" [globalFilterFields]="['description','name']" [scrollable]="true" scrollHeight="500px" >
<ng-template pTemplate="header">
<tr>
<th [pSortableColumn]="'name'">Name <p-sortIcon [field]="'name'"></p-sortIcon></th>
<th [pSortableColumn]="'retention'">Retention <p-sortIcon [field]="'retention'"></p-sortIcon></th>
<th class="hidden-md-down" [pSortableColumn]="'description'">Description <p-sortIcon [field]="'description'"></p-sortIcon></th>
</tr>
</ng-template>
<ng-template pTemplate="body" let-item>
<tr>
<td><a routerLink="{{item.folderId}}">{{item.name}}</a></td>
<td>{{item.retention}}</td>
<td class="hidden-md-down">{{item.description}}</td>
</tr>
</ng-template>
</p-table>