I have two pages. Both of them are supposed to have one table on it
with a fixed header. Both pages were tested in IE6. Structurally they
are identical. Both have a <divthat wraps a <tablethat has a
<theadand a <tbody>. In the first example, the <theadstays fixed
at the top of the div as it scrolls. In the second example the
<theadscrolls away. Could anyone tell me what about the second page
makes it not work?
Thanks
Luminari
###### Working Page ############
<!doctype html public "-//w3c//dtd html 4.0 strict//en">
<html>
<head>
<SCRIPT>
window.onload=f nInit;
function fnInit(){
document.getEle mentById('heade r').style.setEx pression("top",
"document.getEl ementById('tC') .scrollTop");
}
</SCRIPT>
<stylebody {
width: 90%;
}
.tContainer {
overflow: scroll;
overflow-x: hidden;
height: 200px;
}
.tHead {
position: relative;
background-color: black;
color: white;
border: 1px black solid;
}
/*.tBody {
overflow: auto;
overflow-x: hidden;
height: 200px;
}*/
table {
width: 100%;
} </style>
</head>
<body>
<div class="tContain er" id="tC">
<table cellspacing="0" cellpadding="0" >
<thead class="tHead" id="header">
<tr class="tHead">
<th>heading1</th>
<th>heading2</th>
</tr>
</thead>
<tbody class="tBody">
<tr>
<td>cell</td>
<td>cell</td>
</tr>
<tr>
<td>cell</td>
<td>cell</td>
</tr>
<tr>
<td>cell</td>
<td>cell</td>
</tr>
<tr>
<td>cell</td>
<td>cell</td>
</tr>
<tr>
<td>cell</td>
<td>cell</td>
</tr>
<tr>
<td>cell</td>
<td>cell</td>
</tr>
<tr>
<td>cell</td>
<td>cell</td>
</tr>
<tr>
<td>cell</td>
<td>cell</td>
</tr>
<tr>
<td>cell</td>
<td>cell</td>
</tr>
<tr>
<td>cell</td>
<td>cell</td>
</tr>
<tr>
<td>cell</td>
<td>cell</td>
</tr>
<tr>
<td>cell</td>
<td>cell</td>
</tr>
<tr>
<td>cell</td>
<td>cell</td>
</tr>
<tr>
<td>cell</td>
<td>cell</td>
</tr>
<tr>
<td>cell</td>
<td>cell</td>
</tr>
<tr>
<td>cell</td>
<td>cell</td>
</tr>
<tr>
<td>cell</td>
<td>cell</td>
</tr>
<tr>
<td>cell</td>
<td>cell</td>
</tr>
<tr>
<td>cell</td>
<td>cell</td>
</tr>
<tr>
<td>cell</td>
<td>cell</td>
</tr>
<tr>
<td>cell</td>
<td>cell</td>
</tr>
<tr>
<td>cell</td>
<td>cell</td>
</tr>
<tr>
<td>cell</td>
<td>cell</td>
</tr>
<tr>
<td>cell</td>
<td>cell</td>
</tr>
<tr>
<td>cell</td>
<td>cell</td>
</tr>
<tr>
<td>cell</td>
<td>cell</td>
</tr>
<tr>
<td>cell</td>
<td>cell</td>
</tr>
<tr>
<td>cell</td>
<td>cell</td>
</tr>
<tr>
<td>cell</td>
<td>cell</td>
</tr>
<tr>
<td>cell</td>
<td>cell</td>
</tr>
<tr>
<td>cell</td>
<td>cell</td>
</tr>
<tr>
<td>cell</td>
<td>cell</td>
</tr>
<tr>
<td>cell</td>
<td>cell</td>
</tr>
<tr>
<td>cell</td>
<td>cell</td>
</tr>
<tr>
<td>cell</td>
<td>cell</td>
</tr>
<tr>
<td>cell</td>
<td>cell</td>
</tr>
<tr>
<td>cell</td>
<td>cell</td>
</tr>
<tr>
<td>cell</td>
<td>cell</td>
</tr>
<tr>
<td>cell</td>
<td>cell</td>
</tr>
<tr>
<td>cell</td>
<td>cell</td>
</tr>
<tr>
<td>cell</td>
<td>cell</td>
</tr>
<tr>
<td>cell</td>
<td>cell</td>
</tr>
<tr>
<td>cell</td>
<td>cell</td>
</tr>
<tr>
<td>cell</td>
<td>cell</td>
</tr>
<tr>
<td>cell</td>
<td>cell</td>
</tr>
<tr>
<td>cell</td>
<td>cell</td>
</tr>
<tr>
<td>cell</td>
<td>cell</td>
</tr>
<tr>
<td>cell</td>
<td>cell</td>
</tr>
<tr>
<td>cell</td>
<td>cell</td>
</tr>
<tr>
<td>cell</td>
<td>cell</td>
</tr>
<tr>
<td>cell</td>
<td>cell</td>
</tr>
<tr>
<td>cell</td>
<td>cell</td>
</tr>
<tr>
<td>cell</td>
<td>cell</td>
</tr>
<tr>
<td>cell</td>
<td>cell</td>
</tr>
<tr>
<td>cell</td>
<td>cell</td>
</tr>
<tr>
<td>cell</td>
<td>cell</td>
</tr>
<tr>
<td>cell</td>
<td>cell</td>
</tr>
<tr>
<td>cell</td>
<td>cell</td>
</tr>
</tbody>
</table>
</div>
</body>
</html>
###### End Working Page ########
###### Broken Page #############
<!doctype html public "-//w3c//dtd html 4.0 strict//en">
<html>
<head>
<SCRIPT>
window.onload=f nInit;
function fnInit(){
document.getEle mentById('heade r').style.setEx pression("top",
"document.getEl ementById('tabl eWrapper').scro llTop");
}
</SCRIPT>
</head>
<body>
<DIV id=tableWrapper style="OVERFLOW : scroll; WIDTH: 300px; HEIGHT:
200px; overflow-x: hidden"><TABLE style="HEIGHT: 100%" __eventBits="1"
onchange="null" onload="null" onerror="null">
<THEAD style="POSITION : relative" id="header">
<TR>
<TH>
<DIV class=gwt-Label __eventBits="12 5" onchange="null" onload="null"
onerror="null" __hash="2621826 3">Header 0</DIV></TH>
<TH>
<DIV class=gwt-Label __eventBits="12 5" onchange="null" onload="null"
onerror="null" __hash="1355408 8">Header 1</DIV></TH>
<TH>
<DIV class=gwt-Label __eventBits="12 5" onchange="null" onload="null"
onerror="null" __hash="2523263 ">Header 2</DIV></TH>
<TH>
<DIV class=gwt-Label __eventBits="12 5" onchange="null" onload="null"
onerror="null" __hash="1222284 8">Header 3</DIV></TH>
<TH>
<DIV class=gwt-Label __eventBits="12 5" onchange="null" onload="null"
onerror="null" __hash="9186595 ">Header 4</DIV></TH>
<TH>
<DIV class=gwt-Label __eventBits="12 5" onchange="null" onload="null"
onerror="null" __hash="1516927 1">Header 5</DIV></TH></TR></THEAD>
<TBODY>
<TR>
<TD>
<DIV class=gwt-Label __eventBits="12 5" onchange="null" onload="null"
onerror="null" __hash="3363479 ">Cell 0,0</DIV></TD>
<TD>
<DIV class=gwt-Label __eventBits="12 5" onchange="null" onload="null"
onerror="null" __hash="436958" >Cell 1,0</DIV></TD>
<TD>
<DIV class=gwt-Label __eventBits="12 5" onchange="null" onload="null"
onerror="null" __hash="3278711 0">Cell 2,0</DIV></TD>
<TD>
<DIV class=gwt-Label __eventBits="12 5" onchange="null" onload="null"
onerror="null" __hash="2699919 0">Cell 3,0</DIV></TD>
<TD>
<DIV class=gwt-Label __eventBits="12 5" onchange="null" onload="null"
onerror="null" __hash="2659883 7">Cell 4,0</DIV></TD>
<TD>
<DIV class=gwt-Label __eventBits="12 5" onchange="null" onload="null"
onerror="null" __hash="1154792 2">Cell 5,0</DIV></TD></TR>
<TR>
<TD>
<DIV class=gwt-Label __eventBits="12 5" onchange="null" onload="null"
onerror="null" __hash="2434017 1">Cell 0,1</DIV></TD>
<TD>
<DIV class=gwt-Label __eventBits="12 5" onchange="null" onload="null"
onerror="null" __hash="2910006 3">Cell 1,1</DIV></TD>
<TD>
<DIV class=gwt-Label __eventBits="12 5" onchange="null" onload="null"
onerror="null" __hash="2208176 2">Cell 2,1</DIV></TD>
<TD>
<DIV class=gwt-Label __eventBits="12 5" onchange="null" onload="null"
onerror="null" __hash="1881678 6">Cell 3,1</DIV></TD>
<TD>
<DIV class=gwt-Label __eventBits="12 5" onchange="null" onload="null"
onerror="null" __hash="971362" >Cell 4,1</DIV></TD>
<TD>
<DIV class=gwt-Label __eventBits="12 5" onchange="null" onload="null"
onerror="null" __hash="7100172 ">Cell 5,1</DIV></TD></TR>
<TR>
<TD>
<DIV class=gwt-Label __eventBits="12 5" onchange="null" onload="null"
onerror="null" __hash="2317945 2">Cell 0,2</DIV></TD>
<TD>
<DIV class=gwt-Label __eventBits="12 5" onchange="null" onload="null"
onerror="null" __hash="2892737 4">Cell 1,2</DIV></TD>
<TD>
<DIV class=gwt-Label __eventBits="12 5" onchange="null" onload="null"
onerror="null" __hash="1616642 8">Cell 2,2</DIV></TD>
<TD>
<DIV class=gwt-Label __eventBits="12 5" onchange="null" onload="null"
onerror="null" __hash="3204263 ">Cell 3,2</DIV></TD>
<TD>
<DIV class=gwt-Label __eventBits="12 5" onchange="null" onload="null"
onerror="null" __hash="1823585 5">Cell 4,2</DIV></TD>
<TD>
<DIV class=gwt-Label __eventBits="12 5" onchange="null" onload="null"
onerror="null" __hash="1304616 1">Cell 5,2</DIV></TD></TR>
<TR>
<TD>
<DIV class=gwt-Label __eventBits="12 5" onchange="null" onload="null"
onerror="null" __hash="1010939 4">Cell 0,3</DIV></TD>
<TD>
<DIV class=gwt-Label __eventBits="12 5" onchange="null" onload="null"
onerror="null" __hash="1222423 9">Cell 1,3</DIV></TD>
<TD>
<DIV class=gwt-Label __eventBits="12 5" onchange="null" onload="null"
onerror="null" __hash="1892933 5">Cell 2,3</DIV></TD>
<TD>
<DIV class=gwt-Label __eventBits="12 5" onchange="null" onload="null"
onerror="null" __hash="3274248 9">Cell 3,3</DIV></TD>
<TD>
<DIV class=gwt-Label __eventBits="12 5" onchange="null" onload="null"
onerror="null" __hash="3845057 ">Cell 4,3</DIV></TD>
<TD>
<DIV class=gwt-Label __eventBits="12 5" onchange="null" onload="null"
onerror="null" __hash="2217800 7">Cell 5,3</DIV></TD></TR>
<TR>
<TD>
<DIV class=gwt-Label __eventBits="12 5" onchange="null" onload="null"
onerror="null" __hash="2249818 4">Cell 0,4</DIV></TD>
<TD>
<DIV class=gwt-Label __eventBits="12 5" onchange="null" onload="null"
onerror="null" __hash="3256749 6">Cell 1,4</DIV></TD>
<TD>
<DIV class=gwt-Label __eventBits="12 5" onchange="null" onload="null"
onerror="null" __hash="1576475 1">Cell 2,4</DIV></TD>
<TD>
<DIV class=gwt-Label __eventBits="12 5" onchange="null" onload="null"
onerror="null" __hash="1033438 1">Cell 3,4</DIV></TD>
<TD>
<DIV class=gwt-Label __eventBits="12 5" onchange="null" onload="null"
onerror="null" __hash="3159379 2">Cell 4,4</DIV></TD>
<TD>
<DIV class=gwt-Label __eventBits="12 5" onchange="null" onload="null"
onerror="null" __hash="2313658 0">Cell 5,4</DIV></TD></TR>
<TR>
<TD>
<DIV class=gwt-Label __eventBits="12 5" onchange="null" onload="null"
onerror="null" __hash="2094435 ">Cell 0,5</DIV></TD>
<TD>
<DIV class=gwt-Label __eventBits="12 5" onchange="null" onload="null"
onerror="null" __hash="2201074 2">Cell 1,5</DIV></TD>
<TD>
<DIV class=gwt-Label __eventBits="12 5" onchange="null" onload="null"
onerror="null" __hash="1238482 4">Cell 2,5</DIV></TD>
<TD>
<DIV class=gwt-Label __eventBits="12 5" onchange="null" onload="null"
onerror="null" __hash="1221622 2">Cell 3,5</DIV></TD>
<TD>
<DIV class=gwt-Label __eventBits="12 5" onchange="null" onload="null"
onerror="null" __hash="3153987 7">Cell 4,5</DIV></TD>
<TD>
<DIV class=gwt-Label __eventBits="12 5" onchange="null" onload="null"
onerror="null" __hash="2775036 5">Cell 5,5</DIV></TD></TR>
<TR>
<TD>
<DIV class=gwt-Label __eventBits="12 5" onchange="null" onload="null"
onerror="null" __hash="2573832 ">Cell 0,6</DIV></TD>
<TD>
<DIV class=gwt-Label __eventBits="12 5" onchange="null" onload="null"
onerror="null" __hash="3049730 4">Cell 1,6</DIV></TD>
<TD>
<DIV class=gwt-Label __eventBits="12 5" onchange="null" onload="null"
onerror="null" __hash="1361086 2">Cell 2,6</DIV></TD>
<TD>
<DIV class=gwt-Label __eventBits="12 5" onchange="null" onload="null"
onerror="null" __hash="3202827 3">Cell 3,6</DIV></TD>
<TD>
<DIV class=gwt-Label __eventBits="12 5" onchange="null" onload="null"
onerror="null" __hash="3135383 3">Cell 4,6</DIV></TD>
<TD>
<DIV class=gwt-Label __eventBits="12 5" onchange="null" onload="null"
onerror="null" __hash="2735042 3">Cell 5,6</DIV></TD></TR>
<TR>
<TD>
<DIV class=gwt-Label __eventBits="12 5" onchange="null" onload="null"
onerror="null" __hash="6740524 ">Cell 0,7</DIV></TD>
<TD>
<DIV class=gwt-Label __eventBits="12 5" onchange="null" onload="null"
onerror="null" __hash="2424606 9">Cell 1,7</DIV></TD>
<TD>
<DIV class=gwt-Label __eventBits="12 5" onchange="null" onload="null"
onerror="null" __hash="1720950 2">Cell 2,7</DIV></TD>
<TD>
<DIV class=gwt-Label __eventBits="12 5" onchange="null" onload="null"
onerror="null" __hash="1899639 6">Cell 3,7</DIV></TD>
<TD>
<DIV class=gwt-Label __eventBits="12 5" onchange="null" onload="null"
onerror="null" __hash="2507371 1">Cell 4,7</DIV></TD>
<TD>
<DIV class=gwt-Label __eventBits="12 5" onchange="null" onload="null"
onerror="null" __hash="1640138 4">Cell 5,7</DIV></TD></TR>
<TR>
<TD>
<DIV class=gwt-Label __eventBits="12 5" onchange="null" onload="null"
onerror="null" __hash="8238932 ">Cell 0,8</DIV></TD>
<TD>
<DIV class=gwt-Label __eventBits="12 5" onchange="null" onload="null"
onerror="null" __hash="1866465 4">Cell 1,8</DIV></TD>
<TD>
<DIV class=gwt-Label __eventBits="12 5" onchange="null" onload="null"
onerror="null" __hash="907175" >Cell 2,8</DIV></TD>
<TD>
<DIV class=gwt-Label __eventBits="12 5" onchange="null" onload="null"
onerror="null" __hash="2020896 ">Cell 3,8</DIV></TD>
<TD>
<DIV class=gwt-Label __eventBits="12 5" onchange="null" onload="null"
onerror="null" __hash="3763928 ">Cell 4,8</DIV></TD>
<TD>
<DIV class=gwt-Label __eventBits="12 5" onchange="null" onload="null"
onerror="null" __hash="8409752 ">Cell 5,8</DIV></TD></TR>
<TR>
<TD>
<DIV class=gwt-Label __eventBits="12 5" onchange="null" onload="null"
onerror="null" __hash="2614822 0">Cell 0,9</DIV></TD>
<TD>
<DIV class=gwt-Label __eventBits="12 5" onchange="null" onload="null"
onerror="null" __hash="3001510 2">Cell 1,9</DIV></TD>
<TD>
<DIV class=gwt-Label __eventBits="12 5" onchange="null" onload="null"
onerror="null" __hash="1318939 6">Cell 2,9</DIV></TD>
<TD>
<DIV class=gwt-Label __eventBits="12 5" onchange="null" onload="null"
onerror="null" __hash="8119943 ">Cell 3,9</DIV></TD>
<TD>
<DIV class=gwt-Label __eventBits="12 5" onchange="null" onload="null"
onerror="null" __hash="1024621 0">Cell 4,9</DIV></TD>
<TD>
<DIV class=gwt-Label __eventBits="12 5" onchange="null" onload="null"
onerror="null" __hash="1143487 1">Cell 5,9</DIV></TD></TR>
<TR>
<TD>
<DIV class=gwt-Label __eventBits="12 5" onchange="null" onload="null"
onerror="null" __hash="1075175 8">Cell 0,10</DIV></TD>
<TD>
<DIV class=gwt-Label __eventBits="12 5" onchange="null" onload="null"
onerror="null" __hash="6503304 ">Cell 1,10</DIV></TD>
<TD>
<DIV class=gwt-Label __eventBits="12 5" onchange="null" onload="null"
onerror="null" __hash="1360587 2">Cell 2,10</DIV></TD>
<TD>
<DIV class=gwt-Label __eventBits="12 5" onchange="null" onload="null"
onerror="null" __hash="6021038 ">Cell 3,10</DIV></TD>
<TD>
<DIV class=gwt-Label __eventBits="12 5" onchange="null" onload="null"
onerror="null" __hash="6718343 ">Cell 4,10</DIV></TD>
<TD>
<DIV class=gwt-Label __eventBits="12 5" onchange="null" onload="null"
onerror="null" __hash="1964544 7">Cell 5,10</DIV></TD></TR>
<TR>
<TD>
<DIV class=gwt-Label __eventBits="12 5" onchange="null" onload="null"
onerror="null" __hash="1419622 6">Cell 0,11</DIV></TD>
<TD>
<DIV class=gwt-Label __eventBits="12 5" onchange="null" onload="null"
onerror="null" __hash="1425244 5">Cell 1,11</DIV></TD>
<TD>
<DIV class=gwt-Label __eventBits="12 5" onchange="null" onload="null"
onerror="null" __hash="450123" >Cell 2,11</DIV></TD>
<TD>
<DIV class=gwt-Label __eventBits="12 5" onchange="null" onload="null"
onerror="null" __hash="2898741 4">Cell 3,11</DIV></TD>
<TD>
<DIV class=gwt-Label __eventBits="12 5" onchange="null" onload="null"
onerror="null" __hash="4537415 ">Cell 4,11</DIV></TD>
<TD>
<DIV class=gwt-Label __eventBits="12 5" onchange="null" onload="null"
onerror="null" __hash="5428820 ">Cell 5,11</DIV></TD></TR>
<TR>
<TD>
<DIV class=gwt-Label __eventBits="12 5" onchange="null" onload="null"
onerror="null" __hash="2397079 0">Cell 0,12</DIV></TD>
<TD>
<DIV class=gwt-Label __eventBits="12 5" onchange="null" onload="null"
onerror="null" __hash="2931338 7">Cell 1,12</DIV></TD>
<TD>
<DIV class=gwt-Label __eventBits="12 5" onchange="null" onload="null"
onerror="null" __hash="1547951 8">Cell 2,12</DIV></TD>
<TD>
<DIV class=gwt-Label __eventBits="12 5" onchange="null" onload="null"
onerror="null" __hash="1466937 9">Cell 3,12</DIV></TD>
<TD>
<DIV class=gwt-Label __eventBits="12 5" onchange="null" onload="null"
onerror="null" __hash="2467021 3">Cell 4,12</DIV></TD>
<TD>
<DIV class=gwt-Label __eventBits="12 5" onchange="null" onload="null"
onerror="null" __hash="7680063 ">Cell 5,12</DIV></TD></TR>
<TR>
<TD>
<DIV class=gwt-Label __eventBits="12 5" onchange="null" onload="null"
onerror="null" __hash="2256579 1">Cell 0,13</DIV></TD>
<TD>
<DIV class=gwt-Label __eventBits="12 5" onchange="null" onload="null"
onerror="null" __hash="2394067 0">Cell 1,13</DIV></TD>
<TD>
<DIV class=gwt-Label __eventBits="12 5" onchange="null" onload="null"
onerror="null" __hash="1675546 6">Cell 2,13</DIV></TD>
<TD>
<DIV class=gwt-Label __eventBits="12 5" onchange="null" onload="null"
onerror="null" __hash="2384894 2">Cell 3,13</DIV></TD>
<TD>
<DIV class=gwt-Label __eventBits="12 5" onchange="null" onload="null"
onerror="null" __hash="169091" >Cell 4,13</DIV></TD>
<TD>
<DIV class=gwt-Label __eventBits="12 5" onchange="null" onload="null"
onerror="null" __hash="2847658 0">Cell 5,13</DIV></TD></TR>
<TR>
<TD>
<DIV class=gwt-Label __eventBits="12 5" onchange="null" onload="null"
onerror="null" __hash="3107086 7">Cell 0,14</DIV></TD>
<TD>
<DIV class=gwt-Label __eventBits="12 5" onchange="null" onload="null"
onerror="null" __hash="1966304 7">Cell 1,14</DIV></TD>
<TD>
<DIV class=gwt-Label __eventBits="12 5" onchange="null" onload="null"
onerror="null" __hash="2033750 4">Cell 2,14</DIV></TD>
<TD>
<DIV class=gwt-Label __eventBits="12 5" onchange="null" onload="null"
onerror="null" __hash="2147945 3">Cell 3,14</DIV></TD>
<TD>
<DIV class=gwt-Label __eventBits="12 5" onchange="null" onload="null"
onerror="null" __hash="2334724 0">Cell 4,14</DIV></TD>
<TD>
<DIV class=gwt-Label __eventBits="12 5" onchange="null" onload="null"
onerror="null" __hash="1902349 4">Cell 5,14</DIV></TD></TR></TBODY></
TABLE></DIV>
</body>
</html>
###### End Broken Page ########