New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fixed header in mat-table #9143
Comments
No working sample available |
.mat-header-row {
position: sticky;
top: 0;
background-color: inherit;
} |
@oktav777 You should also include .mat-header-row {
position: sticky;
position: -webkit-sticky;
top: 0;
background-color: inherit;
} |
@Chan4077 preprocessor should autoprefix it. |
@oktav777 the css work .but if the hearder has selection,when scroll the below will occur |
Thanks oktav and Chan. The css works fine. But not working in IE 11 |
@stevenmi add .mat-header-row {
top: 0;
position: sticky;
z-index: 1;
background-color: inherit;
} @jayakrishna-v |
ok. I have a basic question. Does Angular Material support IE browsers? |
@jayakrishna-v Yes, IE11 is supported, see here |
ok. Thank you |
i have tried with solution you have provided to fix mat-tab-header , but not working |
Solution does not work if the table is inside |
@soumyakantiroychowdhury did you find a solution? |
@Ch4osCosmo I did not try after that. Will post here if I get a solution. |
is there a fix for this? |
Try this:
|
I want to make the first four columns as sticky. Is there any way in angular mat-table?? |
|
I don't understand why would you say Angular Material is compatible with IE 11, if the property 'sticky: true' of mat table's header is not working in IE 11 ? In addition I see a case where we would need fixed position on header (and not sticky). Suppose you have a fixed header. Setting sticky table's headers would cause them to stick underneath the fixed header, making it invisible. |
This issue has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
Bug, feature request, or proposal: It would be good if we can have a fixed header for mat-table.
What is the expected behavior? Header should always be visible even while scrolling the table body.
What is the current behavior? When the mat-table body is scrolled, the header is also getting scrolled along with the body and getting hidden.
What are the steps to reproduce?
Check the official mat-table link below.
https://material.angular.io/components/table/overview
What is the use-case or motivation for changing an existing behavior?
When we had to show more than 50 records per page, user will have to scroll down to see the bottom records. When we scroll down, header should stay static on top of the table and it helps the user to easily identify which column is what.
Which versions of Angular, Material, OS, TypeScript, browsers are affected?
Is there anything else we should know?
The text was updated successfully, but these errors were encountered: