React table with height and vertical scroll breaks the header positioning
See original GitHub issue
In the example https://react-table.js.org/#/story/fixed-header-w-vertical-scroll
I see that the code
.ReactTable .rt-thead { overflow-y: scroll; }
has been added to offset the scrollbar on the table. However, if you change the number of rows to 5 so that there is no longer a scrollbar on the table then the header will be offset like in the screenshot.
Issue Analytics
- State:
- Created 6 years ago
- Reactions:2
- Comments:10 (4 by maintainers)
Top Results From Across the Web
React table with height and vertical scroll breaks the header ...
I think there are more issues than that. ReactTable was not designed to "scroll" vertically in the first place (it is based on...
Read more >React-Table - Fixed Header + Vertical Scroll - CodeSandbox
CodeSandbox is an online editor tailored for web applications.
Read more ><table> with fixed <thead> and scrollable <tbody> [duplicate]
have fixed header (not scrollable; not sticky) have scrollable <tbody> (scrollbar may be always visible) header and body would handle resizing properly and...
Read more >How to create a table with fixed header and scrollable body
The position property states the type of positioning for an element. The display property states that how an element should be displayed.
Read more >So hard to make table header sticky - DEV Community
Scrolling horizontally at the same time would be tricky with my hacky approach as the header and table no longer syncs position. While...
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
.ReactTable .rt-tbody{ overflow: overlay; } This will put the scroll bar on top of the body. It will realign when you filter or reduce the number of rows.
Solved the issue in a very nice way!!! By using
perfect-scrollbar-react
. The key is thatperfect-scrollbar
doesn’t need extra width for displaying itself.I think that all this is possible due to the high level of customization that
react-table
provides. I’m liking it.