glittershark / reactable

Fast, flexible, and simple data tables in React
glittershark.github.io/reactable
MIT License
1.51k stars 222 forks source link

Cannot make Header row fixed #387

Open Praki06 opened 7 years ago

Praki06 commented 7 years ago

Adding postion:fixed to the header breaks the column layout. Is there any other way to make the headers fixed.

stclairdaniel commented 7 years ago

I think there is another open issue about this, but the short answer is no. Here's a sort of hacky way that will accomplish it though - wrap your table in a div and give it this: onScroll={function(e) {let translate =translate(0,${e.nativeEvent.target.scrollTop}px); document.querySelector(".reactable-column-header" ).style.transform = translate;

kalimuthu123 commented 5 years ago

give me a clear clarification with the code

kalimuthu123 commented 4 years ago

this works for me but it creates the flickering effect in the header when hoever table thead tr:nth-child(1) th{ background: white; position: sticky; top: 0; z-index: 10; }