I have a table with a horizontal scrollbar. I need to make the data of the first two rows sticky when horizontally scroll the table.
This is the table at the first place:
When I scroll I want “2016” and “Dec” to be displayed until I reach “2017” and “Jan”, and the same for 2017 and Jan until I reach the next date.
This is the picture while scrolling:
and the picture when I reach the next date:
Please note that I don’t want numbers to be sticky.
I already used scrollToFixed library for vertical scroll, but i’m not sure if it works in my situation.
Any hints will be appreciated.
You can do it using only css with
position: sticky
.Note:
.sticky
on bothth
and the text to have the effect like this:th
.