intellias_net
asked on
HTML Table: Fixed column and row header - column offset using <center>
In a table there are column header and row headers. The first row displayed in the table should be fixed that is when you scroll the table vertically the top row remains at the top. The first column also needs to be fixed; that is, when you scroll horizontaly the first column remains at the far left potiion.
Using multiple table solution supplied :
http://www.cubido.at/Portals/7/docs/Blog/Karin/HTML%20and%20Javascript/ResizeColumns/Table.htm
This sample fails to align the column headers correctly (offset by 1/2 the scrollbar width) when I use <center> to center the table (and any other elements i desire to have on the form).
e.g. by encasing the sample in the following form
<form>
<center>
<h1>Fixed Headers (resize window to view scrollbars)</h1>
<table border=0 cellspacing=0 cellpadding=0 width=80% >
<tr><td>
............... sample coding of scrollable table
</td></tr>
</table>
</center>
</form>
Using multiple table solution supplied :
http://www.cubido.at/Portals/7/docs/Blog/Karin/HTML%20and%20Javascript/ResizeColumns/Table.htm
This sample fails to align the column headers correctly (offset by 1/2 the scrollbar width) when I use <center> to center the table (and any other elements i desire to have on the form).
e.g. by encasing the sample in the following form
<form>
<center>
<h1>Fixed Headers (resize window to view scrollbars)</h1>
<table border=0 cellspacing=0 cellpadding=0 width=80% >
<tr><td>
............... sample coding of scrollable table
</td></tr>
</table>
</center>
</form>
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
The issue was adding fixed by:
<td align="left"> <--- added alignment
<div class="headerRow">
Also making sure that alignment of the text was consistant from column headers and table body.
<td align="left"> <--- added alignment
<div class="headerRow">
Also making sure that alignment of the text was consistant from column headers and table body.
ASKER
P.S. Ohter solutions using CSS fo fix headers are convient; however, select elements will not respond to z order and will overlay the fixed headers. Additionally the calculations of fixed headers using CSS expression has a nast habbit of locking up CPU time in certain situation causing the calculation of offsetWidth/Heights to take extrordinary time.
http://www.htmlcenter.com/tutorials/tutorials.cfm/61/css/2/
/F