Hi there,
I'm currently facing some challenges with html/css tables and sticky headers in combination with Angular Material.
Within my project, I am utilizing Angular Material's sidenav components such as <mat-sidenav-container>
, <mat-sidenav>
, and <mat-sidenav-content>
. Unfortunately, the sticky header functionality of tables does not seem to work properly inside the <mat-sidenav-container>
.
To help illustrate the issue more clearly, I have created a small GitHub repository:
Repo: https://github.com/ManticSic/angular-material-sticky-table-issue
GH Pages:
The table header seems to be shifted 64px downwards instead of staying fixed at y=64px when scrolling.
Are you aware of any potential solutions to this issue?
Thank you and cheers!
Additional Information
- It would be acceptable if the header remains fixed at the top of the page since only a table is being displayed in this specific view. However, it is crucial that column widths are maintained correctly.
- I am hoping for a resolution without the need for JavaScript.
- The solution should be compatible with the latest versions of Firefox, Chrome/Chromium, Safari, and the Samsung mobile browser.
Tried Solutions That Did Not Work
- Applying
position:fixed
to app-table-header and removingposition:sticky
from cells: Unfortunately, this approach did not work as it resulted in incorrect column widths.