DEV Community

Discussion on: So hard to make table header sticky

Collapse
 
jennieji profile image
Jennie

Hi Ankit, I just see your message. And the post is a bit out-dated! Try this awesome easy approach for the modern browsers instead: css-tricks.com/making-tables-with-...

Scrolling horizontally at the same time would be tricky with my hacky approach as the header and table no longer syncs position.

While we can make the vertical "sticky" scrolling look more natural by applying simple animation on the header, horizontal scroll will not be that straight forward as I can imagine. In this case I will consider to use a special controlled scroll component which allows me to know control the scroll speed animation and apply the same animation to the header. Honestly it's not worth to add such heavy things.