Sticky headers
See original GitHub issueIs your feature request related to a problem? Please describe. Yes.
Describe the solution you’d like Headers to be sticky.
Describe alternatives you’ve considered Finding a way to override styles
Additional context
Seems like the <ScrollBar/>
-component which adds a wrapper with overflow
, makes it impossible.
Not sure why #709 was closed.
Issue Analytics
- State:
- Created 4 years ago
- Comments:15 (4 by maintainers)
Top Results From Across the Web
How To Create an On Scroll Fixed Header - W3Schools
On Scroll Sticky Header. The header will stick to the top when you reach its scroll position. Scroll back up to remove the...
Read more >How To Create the Perfect Sticky Header for Your Site With ...
You'll likely already know what a sticky header is, even in an intuitive sense. It's where your site's header section 'sticks' to the...
Read more >sticky_headers | Flutter Package - Pub.dev
Flutter Sticky Headers - Lets you place headers on scrollable content that will stick to the top of the container whilst the content...
Read more >Sticky Headers: 5 Ways to Make Them Better - CSS-Tricks
Sticky Headers : 5 Ways to Make Them Better · Keep it small. · Visually contrast it with the rest of the page....
Read more >One Line - Sticky Header using CSS - DEV Community
A sticky element toggles between relative and fixed , depending on the scroll position. It is positioned relative until a given offset position ......
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
The reason I closed it is because there is a very easy solution that I found. First you need to set the header style to sticky:
options={{ headerStyle: { position: ‘sticky’, top: 0 } }}
This alone does not do anything. Next you need to set the body height of the table in order to trigger a vertical scrollbar to appear:
options={{ headerStyle: { position: ‘sticky’, top: 0 }, maxBodyHeight: ‘650px’ }}
The combination of these two function will allow you to have sticky table headers. Hope this helps. Perhaps it should be added to the docs if this is an acceptable solution
Is there any way to do this without setting the
maxBodyHeight
?I have a table (without pagination) in a view, where I want a sticky header. But when setting
maxBodyHeight
this creates a new scrollbar within the table. I want the main scrollbar to do the scrolling.Is this possible at the moment? Any tips?