DIV tag causing parent table to extend

liunx

Guest
Here's the problem. I have a DIV tag with a overflow-x value set so that it will scroll if it exceeds the borders of it's width. But not only does it apply the scroll bar but it also expands the table that it is sitting in, and crushes the cell to it's left.<br />
<br />
<table height=83% border=1><br />
<tr height=100%><br />
<td width=100 height=100%><br />
<br />
</td><br />
<td valign=top><br />
<div id=main style="position:relative;;width:100%;overflow-x:auto;"><br />
<br />
<br />
<%<br />
SQL = "Select * from mytable"<br />
RS.open SQL, conn<br />
<br />
howmanyfields =rs.fields.count-1<br />
response.write "<table><tr>"<br />
<br />
for i=0 to howmanyfields<br />
response.write ("<td>" & rs(i).name & "</td>" & Chr(13))<br />
next<br />
response.write "</tr>"<br />
<br />
do until rs.eof<br />
response.write "<tr>"<br />
for i=0 to howmanyfields<br />
response.write "<td>" & rs(i) & "</td>" & Chr(13))<br />
next<br />
response.write "</tr>"<br />
rs.movenext<br />
<br />
%><br />
</table><br />
</div><br />
</td><br />
</tr><br />
</table><br />
<br />
<br />
The problem is when the recordset that is created is bigger than the width of the page it does create the scroll bar on the DIV tag, but only after it expands the table that holds the tag until it is wide enough to fit the entire recordset. <br />
<br />
I am not really worried about the page extending beyond the bottom, becuase it will need to scroll down anyway. It's just the X value that I am worried about...<br />
<br />
Anyone know what is causing this, and how to fix it?<br />
<br />
:mad:<!--content-->Try using <TABLE STYLE="table-layout:fixed" ...><br />
as your outer table.<br />
<br />
For more info, see <!-- m --><a class="postlink" href="http://msdn.microsoft.com/workshop/author/dhtml/reference/properties/tablelayout.asp">http://msdn.microsoft.com/workshop/auth ... layout.asp</a><!-- m --><!--content-->:) <br />
<br />
The table-layout:fixed option worked perfectly, allowed me to carry my reports over and have the overflow option in the div tag generate the scroll bar.<br />
<br />
Thanks<!--content-->
 
Back
Top