I am trying to accomplish a simple 'liquid layout' with two width=50% boxes on the left and one width=50% box on the right, where the height of the rightmost box follows the leftmost boxes and vice versa. I want a spacing between the boxes of 10px, a nice 3d feel for the boxes and no border or margin on the outside.
I have tried to implemented this using DIV tags only, but didn't succeed. Due to lack of time I switched to a more familiar TABLE/TR/TD approach. Indeed the table cell height followed the total table height, however when I introduces DIV tags in the table cells so I could implement my 3D box border, the height shrinked again. No matter at which places in my code I try to put "height=100%", my browser doesn't seem to act on it.
The problem is related to a question already asked on StackOverflow before (linked here). The proposed solution there is to use TABLE instead of DIV. In my case this will not work if I want to stick to both my 3D boxes and the spacing between my cells.
I have included my code below containing two different approaches, both not working. Can somebody suggest me a way to fix my code so that the height of the box on the right will become 100% of the size of its TD container (shown green in the example?). Any other approaches with the same result are also very welcome. UPDATE: Tor Valamo posted an answer pointing out where to place the 100%. Unfortunately, the result works only in IE and Firefox, not Chrome. The search therefore continued for a browser-independent solution.
UPDATE: After receiving several useful suggestions, I've posted my own solution which is the only one acceptable to me at this point. Unfortunately it uses TABLE not DIV. Some work has been done on a DIV solution, for anyone who'd like to finish the job, the sources codes are available here.
<html>
<head>
<style>
.outsidetable {
border-collapse: collapse;
border-style: hidden;
}
.outsidecell {
border-width: 10px;
border-color: #FFF;
padding: 0px;
border-style: solid;
background-color: #0F0;
}
.fancybox {
border-style: outset;
border-color: yellow;
border-width: 2px;
background-color: #CCF;
}
</style>
</head>
<body>
<!-- First example, using DIV to draw the boxes
and TABLE/TR/TD for the layout -->
<p>
<table class=outsidetable>
<tr>
<td class=outsidecell><div class=fancybox>
Lorem ipsum dolor sit amet,
consectetur adipisicing elit,
sed do eiusmod tempor incididunt
ut labore et dolore magna aliqua.
</div></td>
<td class=outsidecell rowspan=2><div class=fancybox height=100% style="height: 100%">
Lorem ipsum dolor sit amet,
consectetur adipisicing elit,
sed do eiusmod tempor incididunt
ut labore et dolore magna aliqua.
</div></td>
</tr>
<tr>
<td class=outsidecell><div class=fancybox>
Lorem ipsum dolor sit amet,
consectetur adipisicing elit,
sed do eiusmod tempor incididunt
ut labore et dolore magna aliqua.
</div></td>
</tr>
</table>
</p>
<!-- Second example, using TABLE instead of DIV to draw the boxes
(and again TABLE/TR/TD for the layout) -->
<p>
<table class=outsidetable>
<tr>
<td class=outsidecell><table class=fancybox><tr><td>
Lorem ipsum dolor sit amet,
consectetur adipisicing elit,
sed do eiusmod tempor incididunt
ut labore et dolore magna aliqua.
</td></tr></table></td>
<td class=outsidecell rowspan=2><table class=fancybox height=100% style="height: 100%"><tr><td height=100% style="height: 100%">
Lorem ipsum dolor sit amet,
consectetur adipisicing elit,
sed do eiusmod tempor incididunt
ut labore et dolore magna aliqua.
</td></tr></table></td>
</tr>
<tr>
<td class=outsidecell><table class=fancybox><tr><td>
Lorem ipsum dolor sit amet,
consectetur adipisicing elit,
sed do eiusmod tempor incididunt
ut labore et dolore magna aliqua.
</td></tr></table></td>
</tr>
</table>
</p>
</body>
</html>