Forum Moderators: not2easy
Does anybody know of a workaround for this? Thanks.
<?xml version="1.0" encoding="iso-8859-2"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/2000/REC-xhtml1-20000126/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="cs" lang="cs">
<head>
<meta http-equiv="content-type" content="text/html; charset=iso-8859-2" />
<title>Untitled</title><style>
* {
border: 0;
padding: 0;
margin: 0;
}div#rightColumn {
float: right;
width: 300px;
background: lime;
}div#leftColumn {
margin-right: 300px;
background: pink;
}table {
width: 100%;
background: red;
}</style>
</head><body>
<div id="rightColumn">
stuff right
</div>
<div id="leftColumn">
<table>
<tr><td>
hey!
</tr></td>
</table>
</div>
</body>
</html>
Thanks for the help.
<style>
body {
margin: 0;
padding: 0;
}
div#rightColumn {
float: right;
position: relative;
width: 300px;
background: #f00;
}
div#leftColumn {
position: relative;
background: #0f0;
width: 700px;
float: left;/*Ie behaves the same way as FF now..*/
}
table {
width: 100%;
background: #00f;
}
</style>
</head>
<body>
<div id="rightColumn">
rightColumn
</div>
<div id="leftColumn">
LeftColimn
<table>
<tr><td>
hey!
</tr></td>
</table>
</div>
</body>
</html>
To have the table always filling the container div width in a cross-browser manner requires supplying IE5 with two variants. This can be done as a hack within your main stylesheet or as a separate stylesheet supplied via a conditional statement.
The main stylesheet remains as per your posted example.
Then supply IE5:
table {
width: auto; /* to over-ride the explicit width causing the problem. */
table-layout: fixed; /* to get the always 100% width desired */
}
Note: If not a posting error you should reverse the </tr></td> in the html.