I am looking for a way to make a div expand to the full width of the HTML document based on its content.
Consider this scenario:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Traditional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
<title>testing</title>
<style type="text/css">
body
{
background-color:pink;
padding:0;
margin:0;
}
#testDiv
{
background-color:red;
}
</style>
</head>
<body>
<div id="testDiv">
<table width="2000px">
<tr>
<td>
test
</td>
</tr>
</table>
</div>
</body>
</html>
The testDiv currently only extends to the size of the browser window and not the entire page itself. While I have achieved this using a table layout, I am seeking a CSS solution that also works for IE 7.