Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

DIV tag Expanding Table

Status
Not open for further replies.

Dynapen

Programmer
Apr 20, 2000
245
US
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.

<table height=83% border=1>
<tr height=100%>
<td width=100 height=100%>

</td>
<td valign=top>
<div id=main style=&quot;position:relative;;width:100%;overflow-x:auto;&quot;>


<%
SQL = &quot;Select * from mytable&quot;
RS.open SQL, conn

howmanyfields =rs.fields.count-1
response.write &quot;<table><tr>&quot;

for i=0 to howmanyfields
response.write (&quot;<td>&quot; & rs(i).name & &quot;</td>&quot; & Chr(13))
next
response.write &quot;</tr>&quot;

do until rs.eof
response.write &quot;<tr>&quot;
for i=0 to howmanyfields
response.write &quot;<td>&quot; & rs(i) & &quot;</td>&quot; & Chr(13))
next
response.write &quot;</tr>&quot;
rs.movenext

%>
</table>
</div>
</td>
</tr>
</table>


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.

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...

Anyone know what is causing this, and how to fix it?
 
I found the answer to the question posted above, and figured I would post it here in case anyone else had it.

<Table style=&quot;table-layout:fixed;&quot;>

This forces the table contents to fit in the table, and won't allow the table to expand to fit anything bigger than the window itself. The money's gone, the brain is shot.....but the liquor we still got.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top