I would like to know how to display a vertical scroll bar for the rows only (headers are not moving) with Angular Material mat-table. When I set overflow: auto
and max-height
in mat-table
style, the whole table (including the headers) are scrolled.
Thanks for your help.
You may use the sticky property of MatHeaderRowDef:
<tr mat-header-row *matHeaderRowDef="displayedColumns; sticky: true"></tr>