table width properties

admin

Administrator
Staff member
Is there a way to make a table that is flexible but have constraints as to how big or small it could flex? <br />
ex.<br />
<table width="not less than 300px and not wider than 500px"><br />
<br />
thanks in advance.<!--content-->Nesting it within a larger table that that's been divided into two TDs with one of the TDs set for a fixed width? I'm not sure, but if you set the variable width table in the non fixed width TD to 100%, would that be 100% of the remaining TR or would it confuse the browser? Good experiment to try.<!--content-->I would nest a table inside another one. Make the parent table the max width you want, ie 500px and make the enclosed one 100%. This will make your table 500px width most of the time, until the screen res is less than 500 and then the inside one will become 100% of the screen res. In theory anyway.<!--content--><table width=500 cellspacing=0 cellpadding=0 border=0><br />
<tr><br />
<td><br />
<img name='empty' src='http://www.htmlforums.com/archive/index.php/dot.gif' width=300 height=1><br />
<!-- Transparent gif image --><br />
</td><br />
</tr><br />
<tr><br />
<td><br />
Your regular table contents starts here<br />
</td><br />
</tr><br />
</table><br />
<br />
<br />
The transparent gif will ensure a minimum width of 300 pixels (the height of this gif is only 1 pixel so it wont interfer with your layout).<!--content-->just set the table to like 70% or so. it will always be lower than 500 and above 300, if resolution permits it.<!--content-->Yes, I forgot the table inside:<br />
<br />
<table width=500 cellspacing=0 cellpadding=0 border=0><br />
<tr><br />
<td><br />
<table cellspacing=0 cellpadding=0 border=1 width=100%><br />
<tr><br />
<td><br />
<img name='empty' src='http://www.htmlforums.com/archive/index.php/dot.gif' width=300 height=1><br />
<!-- Transparent gif image --><br />
</td><br />
</tr><br />
<tr><br />
<td><br />
Your regular table contents starts here<br />
</td><br />
</tr><br />
</table><br />
</td><br />
</tr><br />
</table><br />
<br />
:)<!--content-->
 
Back
Top