View Full Version : Lock Table Headers
10-05-2003, 10:55 PM
Is there a way to lock an html table header so that it doesn't scroll but the rest of the table does. Similar to excel when you lock a row?
10-05-2003, 11:23 PM
Have you tried using thead, tfoot and tbody, and set a explicit (preferably absolute) height on the tbody, together with an overflow: auto;?
10-05-2003, 11:25 PM
I was just looking into somthing similar your suggestion will allow me to go a little deeper now. I'll try it. Thanks.
10-05-2003, 11:35 PM
Well, I'm not sure it'll work. The different table elements can behave weird sometimes, and the css spec is not clear about them at all times. It's just my "best shot" at how to work it out. If it doesn't work you can try it on the table element, putting the header and footer in separate tables before and after. It's not as elegant or correct a solution, but it might have better support.
That's all speculation, though. Test the tbody/thead/tfoot elements first.
10-05-2003, 11:41 PM
Doesn't seem to work. I see that it is easily done by using a seperate table as the header but my table is sortable so I need to do it with a single table.
here is the code for the table sorry it is kind of messy.
window.pane.document.writeln('<TR bgcolor="#FFFFFF" style="overflow:auto;"><td class="blue">' + userlist[i] + '</td><td class="pink">' + fullcountuser[i] + '</td><td class="blue">' + mdnlist[i] + '</td><td class="pink">' + fullcountmdn[i] + '</td><td class="blue">' + superlist[i] + '</td><td class="pink">' + pinnerlist[i] + '</td><td class="blue">' + whenlist[i] + '</td><td class="pink">' + timerlist[i] + '</td></tr>');
Powered by vBulletin® Version 4.2.2 Copyright © 2016 vBulletin Solutions, Inc. All rights reserved.