A simple table whose first column is sticky should work.
Does not work good:
Just create a table, as simple as can be, with the first column being sticky:
https://stackblitz.com/edit/angular-sticky-column-bug?file=src/app/app.component.ts
https://angular-sticky-column-bug.stackblitz.io/
Screenshots:
Initial state: 
Start scrolling: 
Scroll some more: 
At least 7.3.6.
I did some more investigating. This only happens if:
<mat-table>, <mat-header-cell>) rather than attribute based (<table mat-table>, <th mat-header-cell> etc...)Just umping in to say that I think the "attribute-based" <table mat-table> is the preferred alternative since it has been available.
If you can use the table native element, I reckon you should go for it. It also lets you painlessly use the overflow properties to enable scrolling, and probably lets you avoid a few other quirks I don't know of.
Disclaimer: I'm not denying there's a problem 馃檪
If I recall correctly, this was expected about the flexbox-based table, but it was supposed to be documented. @andrewseguin was that right?
I am trying to use the material table with 4 sticky columns, 2 of them to left and 2 of them to right. The problem is that the offset is calculated wrong by sticky and stickyEnd attributes from angular material. Does anyone have the same issue?
Here is an example with how I am using sticky and stickyEnd.
https://stackblitz.com/edit/angular-kueky5?file=src%2Fapp%2Ftable-sticky-columns-example.html
Same problem!
Same problem
"@angular/material": "^8.2.3",
"@angular/core": "~8.2.14",
Issue still exists.
I did some more investigating. This only happens if:
- You use "component-based" material tables (aka
<mat-table>,<mat-header-cell>) rather than attribute based (<table mat-table>,<th mat-header-cell>etc...)- You give your columns a min-width
Thank you for pointing that out. I was able to workaround the issue by giving the table a minimum width instead.
Most helpful comment
I am trying to use the material table with 4 sticky columns, 2 of them to left and 2 of them to right. The problem is that the offset is calculated wrong by sticky and stickyEnd attributes from angular material. Does anyone have the same issue?
Here is an example with how I am using sticky and stickyEnd.
https://stackblitz.com/edit/angular-kueky5?file=src%2Fapp%2Ftable-sticky-columns-example.html