What I meant was that using tables for your layout is abuse, but nesting them is even worse.
It just makes the code harder to read, and when modifying it in the future it's easy to mess it up. If you must use tables, here's a css trick. Put your table in the div, and adjust the height+width accordingly.
HTML Code:
<html>
<html>
<head>
<style type="text/css">
#myContent {
border:1px solid black;
position:absolute;
left:50%;
top:50%;
margin-top:-150px;
margin-left:-250px;
width:500px;
height:300px;
}
</style>
</head>
<body>
<div id="myContent">myContent</div>
</body>
</html>
What you're doing is positioning the element absolutely at 50% from the top, and 50% from the left. Then using negative margins, moving it over and up for half of the size of the div.
This method does have limitations though, for instance, if you resize the browser to smaller than the div, you the top and left get cut off. Make sure when using this method, you are taking into consideration an 800x600 resolution.
Bookmarks