I've seen examples here and there of a trick to use
position:absolute
on the first column of a table, and then make the rest of the table scrollable horizontally.
This works, as seen here: http://jsfiddle.net/YMvk9/4289/
However, as soon as I added the vertical scrollbar you can see that it does not scroll the frozen pane, instead, the frozen pane now sticks down from the rest of the table in a ugly sort of way.
I need the frozen column on the left to scroll vertically. Can anyone fix the jsfiddle code?
Assuming that what you want is for the user to be able to scroll the table vertically or horizontally there are several ways to achieve this. The most straightforward would be to put your
headcol
cells in a table all there own then position the two tables so they are right up against each other and wrap them both in a div withoverflow:scroll
. I did come up with a patch-work fix for your current layout though.Here is the FIDDLE
You had several problems:
overflow
property was only applying to the second column of the table.overflow:scroll:
property to that.long
class so I assigned that tofloat:right;
and gave it amargin-left
to account for theheadcol
cells.Hope that helps!
UPDATE: After posting I noticed one issue in that adding
margin-left
to yourlong
class screwed up the way the table looked to I removed that rule and addedpadding-left
to thediv
to fix the issue. There may still be a couple minor margin & padding tweaks you need to do to make the table look just right; but it works! I updated the fiddle too.