...

View Full Version : container height auto, table height 100%



max.blomberg
12-19-2007, 11:21 AM
Please help. I have been googling for a solution to this problem but it seems it is actually impossible to do. I am not yet 100% sure it is impossible so as a last resort I make this thread.

The code looks like this:

<html>
<head>
<title>untitled</title>
<style>
#container {
position:relative;
width:75%;
height:auto;
margin:10% auto;
border:1px solid blue;
}
#table {
position:absolute;
top:0;
left:0;
width:100%;
height:100%;
border:1px solid red;
}
#table td {
border:1px solid yellow;
}
</style>
</head>
<body>
<div id="container">
<p>contents</p>
<table id="table">
<tr>
<td></td>
<td></td>
<td></td>
</tr>
<tr>
<td></td>
<td></td>
<td></td>
</tr>
<tr>
<td></td>
<td></td>
<td></td>
</tr>
</table>
</div>
</body>
</html>

This does work if #container has a specified height instead of "auto". But unless #container's height is auto this design is pointless. The point is that the absolute positioned table is going to contain images as a very nice background to the other contents inside #container.

Apostropartheid
12-19-2007, 03:28 PM
Yeah, right, so what are we supposed to be doing?



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum