Code: Select all
[scrollable]="true" scrollHeight="calc(100vh - 21rem)"
Table without [scrollable]="true"
Table with [scrollable]="true"
Finally, here is p-table tag code snippet:
Code: Select all
<p-table #dt [value]="comments" [columns]="cols" [scrollable]="true" scrollHeight="calc(100vh - 21rem)"
styleClass="p-datatable-gridlines" [rowHover]="true"
[rows]="10" [showCurrentPageReport]="true" [rowsPerPageOptions]="[10,25,50]"
[paginator]="true" currentPageReportTemplate="Showing {first} to {last} of {totalRecords} entries">