This is again one of these old issues: I would like to make the four first columns of my HTML-Table sticky (only horizontally).
There are several solutions out there which work properly if it's a smaller table. Unfortunately mine has a big size and I would like it to spread it over the whole screen. Therefore most solutions which pack the table in a scrollable div are no use because they put the scrollbar at the very end of the div - which is quite a distance to go down.
Also there is some small content over the table so it's yet not 100% of the screen...
There were some ideas around the Internet to give the frozen tds the position: absolute;
attribute which didn't work for me.
http://www.fixedheadertable.com/ seems kinda fine - unfortunately till now it just messes up my table...
EDIT 1: It's a pretty huge table which displays a database and does some calculation with its values. That's one of my problems: It always has the same amount of columns (about 50) but the number of rows vary. But in general the table is kinda straight-forward with no surprises:
<table id="calctbl">
<thead class="fixed">
<tr id="table-head">
<th class="several classes">Number<br>
<br>Pos. Nr.</th>
<th class="several classes">Info 1</th>
<th class="several classes"><div>More infos</div></th>
<th class="several classes">Here<br>are some more<br>infos</th>
<th>... and it goes on ...</th>
</tr>
</thead><tbody>
<tr>
<td class="several other classes">vals...</td>
<td class="several other classes">more vals</td>
<td class="several classes"><div>and some more</div></td>
<td class="several other classes">...</td>
<td>... and it goes on ...</td>
</tr>
<tr>
<!-- No big surprises, it just goes on -->
</tr>
</tbody>
</table>
Also I use this for the first header line: HTML table with fixed headers?
EDIT 2:
- http://www.fixedheadertable.com/ - there is not really an explanation and for some reason it just messes everything up
- http://tympanus.net/codrops/2014/01/09/sticky-table-headers-columns/ Has the mentioned problem: It requires a limiting div around it
- how do I create an HTML table with fixed/frozen left column and scrollable body? Answer #1: Same problem with the div
- position: fixed - doesn't work at all for me
- How can I make the first and second column of a table sticky Answer #1 - dosen't work either
- http://massless.org/_tests/grid1/ - seems to be quite old and requires a div
- http://learndevelopingmyway.blogspot.co.at/2012/03/sticky-columnsheaders-freeze-pane-in.html is this even a table?