monir tuhin
monir tuhin

Reputation: 541

How to fix a single column in horizontal scrolling of mat-table in Angular Material 2

I am using Angular Material 2 with Angular 5. I am using mat-table. I want to fix a single column in mat-table. When i scroll the horizontal bar then a column will fix and not scrolling. Is there possible to fixed a column in mat-table.

Angular Material 2: mat-table link

Upvotes: 2

Views: 7464

Answers (1)

amalgama
amalgama

Reputation: 73

From material documentation:

It is also possible to fix cell columns to the start or end of the horizontally scrolling viewport. To do this, add the sticky or stickyEnd directive to the ng-container column definition.

Here is example

Upvotes: 6

Related Questions