My calendar has a list of users on the left side and dates with cells on the right side. I need to ensure that the dates stay fixed at the top when scrolling to the bottom of the page. However, this is proving tricky because my main table containing the dates has overflow:scroll set for scrolling purposes while also needing to keep the left-side users fixed.
How can I achieve fixing the <thead>
element with dates at the top even with nested tables and overflow:scroll
? One possible solution could be to split the table into two separate tables for thead and tbody sections and then catch the scroll event to synchronize them. Would this approach work?
Check out the JSFiddle demonstration here - https://jsfiddle.net/p69j0L5h/2/
P.S. In reality, all cells have equal dimensions (width and height). This example is just a simplified version for illustration purposes.