Link to home
Start Free TrialLog in
Avatar of Finnbin
Finnbin

asked on

I.E 5.5 and scrolling table

I want to create a table with stationary headers and footers but with a scrollable body. Scroll bars have to be on both the left and right sides of the body.
Avatar of knightEknight
knightEknight
Flag of United States of America image

if you don't mind using IFrames, you can do this:


<HTML>
<BODY>
<CENTER>

<TABLE border='1' cellpadding='0' cellspacing='0'>
 <TR>
  <TH>Heading 1</th>
  <TH>Heading 2</th>
  <TH>Heading 3</th>
  <TH>Heading 4</th>
  <TH comment='this is the scrollbar spacer'>&nbsp;&nbsp;&nbsp;</th>
 </tr>
 <TR>
  <TD colspan='5'><IFRAME name='myIFrame' id='myIFrame' src='myTable.htm' border='0' frameborder='0' marginwidth='0' marginheight='0' ></iframe></td>
 </tr>
 <TR>
  <TH>Footer 1</th>
  <TH>Footer 2</th>
  <TH>Footer 3</th>
  <TH>Footer 4</th>
  <TH></th>
 </tr>
</table>

</center>
</body>
</html>




then put this in myTable.htm:


<HTML>
<BODY marginheight="0" marginwidth="0">
<CENTER>

<TABLE border='1' width='100%'  cellpadding='0' cellspacing='0'>
 <TR width='100%'>
  <TD>data 1-1</td>
  <TD>data 1-2</td>
  <TD>data 1-3</td>
  <TD>data 1-4</td>
 </tr>
 <TR>
  <TD>data 2-1</td>
  <TD>data 2-2</td>
  <TD>data 2-3</td>
  <TD>data 2-4</td>
 </tr>
 <TR>
  <TD>data 3-1</td>
  <TD>data 3-2</td>
  <TD>data 3-3</td>
  <TD>data 3-4</td>
 </tr>
 <TR>
  <TD>data 4-1</td>
  <TD>data 4-2</td>
  <TD>data 4-3</td>
  <TD>data 4-4</td>
 </tr>
 <TR>
  <TD>data 5-1</td>
  <TD>data 5-2</td>
  <TD>data 5-3</td>
  <TD>data 5-4</td>
 </tr>
 <TR>
  <TD>data 6-1</td>
  <TD>data 6-2</td>
  <TD>data 6-3</td>
  <TD>data 6-4</td>
 </tr>
 <TR>
  <TD>data 7-1</td>
  <TD>data 7-2</td>
  <TD>data 7-3</td>
  <TD>data 7-4</td>
 </tr>
 <TR>
  <TD>data 8-1</td>
  <TD>data 8-2</td>
  <TD>data 8-3</td>
  <TD>data 8-4</td>
 </tr>
 <TR>
  <TD>data 9-1</td>
  <TD>data 9-2</td>
  <TD>data 9-3</td>
  <TD>data 9-4</td>
 </tr>
</table>

</center>
</body>
</html>
and this is an improvement (specifying width for each column)


<HTML>
<BODY>
<CENTER>

<TABLE border='1' cellpadding='0' cellspacing='0'>
 <TR>
  <TH width='160' nowrap>&nbsp; Heading 1 &nbsp;</th>
  <TH width='160' nowrap>&nbsp; Heading 2 &nbsp;</th>
  <TH width='160' nowrap>&nbsp; Heading 3 &nbsp;</th>
  <TH width='160' nowrap>&nbsp; Heading 4 &nbsp;</th>
  <TH width='15'  comment='this is the scrollbar spacer'>&nbsp;</th>
 </tr>
 <TR>
  <TD colspan='5'><IFRAME name='myIFrame' id='myIFrame' src='myTable.htm' width='100%' border='0' frameborder='0' marginwidth='0' marginheight='0' ></iframe></td>
 </tr>
 <TR>
  <TH>Footer 1</th>
  <TH>Footer 2</th>
  <TH>Footer 3</th>
  <TH>Footer 4</th>
  <TH></th>
 </tr>
</table>

</center>
</body>
</html>



myTable.htm:

<HTML>
<BODY marginheight="0" marginwidth="0">
<CENTER>

<TABLE border='1' width='100%'  cellpadding='0' cellspacing='0'>
 <TR width='100%'>
  <TD width='160'>data 1-1</td>
  <TD width='160'>data 1-2</td>
  <TD width='160'>data 1-3</td>
  <TD width='160'>data 1-4</td>
 </tr>
 <TR>
  <TD>data 2-1</td>
  <TD>data 2-2</td>
  <TD>data 2-3</td>
  <TD>data 2-4</td>
 </tr>
 <TR>
  <TD>data 3-1</td>
  <TD>data 3-2</td>
  <TD>data 3-3</td>
  <TD>data 3-4</td>
 </tr>
 <TR>
  <TD>data 4-1</td>
  <TD>data 4-2</td>
  <TD>data 4-3</td>
  <TD>data 4-4</td>
 </tr>
 <TR>
  <TD>data 5-1</td>
  <TD>data 5-2</td>
  <TD>data 5-3</td>
  <TD>data 5-4</td>
 </tr>
 <TR>
  <TD>data 6-1</td>
  <TD>data 6-2</td>
  <TD>data 6-3</td>
  <TD>data 6-4</td>
 </tr>
 <TR>
  <TD>data 7-1</td>
  <TD>data 7-2</td>
  <TD>data 7-3</td>
  <TD>data 7-4</td>
 </tr>
 <TR>
  <TD>data 8-1</td>
  <TD>data 8-2</td>
  <TD>data 8-3</td>
  <TD>data 8-4</td>
 </tr>
 <TR>
  <TD>data 9-1</td>
  <TD>data 9-2</td>
  <TD>data 9-3</td>
  <TD>data 9-4</td>
 </tr>
</table>

</center>
</body>
</html>
ASKER CERTIFIED SOLUTION
Avatar of b1xml2
b1xml2
Flag of Australia image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Notes
=====
The functionality in the HTML Page can be made MSIE 4 compatible as well.

Usage
=====
1. CSS Property overflow. Value: auto
2. MSIE HTML Scroll Attribute On Body. Value: no
3. MSIE5+ CSS Property scrollbar-base-color.
4. A hidden div on each 3 tables with the same settings. This allows for the relevant scroll bar to appear.
5. CSS Property table-layout. Value: fixed
This allows for the three tables to sync in size when used with #4.
6. Usage of MSIE5+ Only DOM Method:
 element.style.setExpression(<property>,<expression>);
7. Initial value of 300px for height which will be changed by #6.
8. The change is effected by calculating
a. the current height available for the client - document.body.clientHeight
b. the current height of the header -
document.all.header.offsetHeight
c. the current height of the footer
document.all.footer.offsetHeight
Avatar of Finnbin
Finnbin

ASKER

Good answers from both guys, just don't know which one to pick. Will go with KnightEKnight because he was in first.
Thanks for the help.
This question has been abandoned. I will make a recommendation to the
moderators on its resolution in a week or two. I appreciate any comments
that would help me to make a recommendation.
<note>
   In the absence of responses, I will recommend DELETE unless it is clear
   to me that it has value as a PAQ.  Silence = you don't care
</note>

Cd&
Don't delete ... Finnbin has already stated that the answers provided are good, so why would you delete this instead of offering points?
kEk,

A delete would only happen if there is no clear value in the PAQ.  The post is a cut and paste ping, intended to get recommendations.  When there are no recommendations it is more work for me and the mods to get them cleaned up.  If we were using the autograde/autodelete we would hvae lost tens of thousands of good PAQs.  

This way is a lot of work but if we can get recommendations and save the Qs, it is worth it.

Cd&
OK Cd& ...
"value as a PAQ" is a subjective term -- there are many repeated Q-and-A's in the PAQ.  Anyway, if I believe I have made a significant effort or contribution on a given question, I'll just leave a "please don't delete" comment -- so as not to be "silent" about it.
Yeah, delete is sort of the default if no one wants to keep it.  Like the old autodelete.

Cd&