I'm trying to make an excel type grid with a heading along the top and labels down the left hand side. I want the content to be scrollable but both the headings along the top and labels down the left hand side visible at all times. Is this possible? E.g.
A B C D E F G
1
2
3
4
What I want is that you to be able to scroll across but keep the numbers at the side... so scrolling left would show:
B C D E F G H
1
2
3
4
But I also want it so you can scroll down and still see the headings at the top:
B C D E F G H
2
3
4
5
there could be data each of the cells that needs to remain correctly lined up with its heading and left hand label.
One or the other is easy using overflow: auto on a container, but is it possible to have both?
Is this possible using pure CSS or does it require javascript?
I can position: absolute either the lefthand labels, or the header labels. This causes a problems: If the header is absolutely positioned then scrolling the table left does not affect the header. If the left hand column is absolutely positioned scrolling the table down does not affect the left hand column.
edit: Here's what I have so far: http://jsfiddle.net/sts5uh6s/2/ This works for the left hand labels and the top heading, but the left hand labels dont scroll with the content