Page 1 of 1

Table with 100% width relative to parent div

Posted: Wed Jul 19, 2006 8:11 am
by Nathaniel
A work-around for this has to be documented somewhere, but I have been googling for half an hour and I'm stuck. Basically, I have a table inside a div:

Code: Select all

<div>
<table>
<tr>
<td>Blah</td>
</tr>
</table>
And then I have this CSS:

Code: Select all

div
{
	margin-left: 21em;
	margin-right: 9em;
}

table
{
	width: 100%;
}
I want the table to be 100% of the width of the div tag, not the browser window. In Firefox it's all well and dandy, but not in IE6. What do I do about it?

Posted: Wed Jul 19, 2006 3:13 pm
by Benjamin
Try setting the width of the parent div.