View Full Version : centering tables that include divs

10-23-2007, 04:12 AM
I cant seem to find the solution anywhere but I am making a layout in which I made a centered table that the website sits in. If I position the divs absolute they don't stay in the table but move according to size of browser. How do I get the divs to stay stuck in their part of the table regardless of browser size?

10-23-2007, 05:56 AM
Is the table absolutely necessary? You should be able to take the divs out of the table and position them precisely where you want using CSS.

Can you post some of your code so we can see what you are doing?

10-23-2007, 04:05 PM
This is the code as is. The problem is I want the divs absolute WITHIN the table so the whole late centers itself. the way I've done it the table centers itself and the divs stay where they were. I am unsure how to fix this.

<link rel="SHORTCUT ICON" href="icon.ico">
<link href="winter.css" rel="stylesheet" type="text/css">

<body leftmargin="0" topmargin="5">
<center><table border="0" cellpadding="0" cellspacing="0">
<td><img src="images/winterlayout.jpg" usemap="#winterlayout_01_Map" border="0"></td>
<map name="winterlayout_01_Map">
<area shape="rect" alt="" coords="687,101,727,113" href="#">
<area shape="rect" alt="" coords="576,101,670,113" href="#">
<area shape="rect" alt="" coords="510,101,560,113" href="#">
<area shape="rect" alt="" coords="422,101,493,113" href="#">
<area shape="rect" alt="" coords="320,101,404,112" href="#">
<area shape="rect" alt="" coords="203,101,302,113" href="#">
<div id="layer1" style=" color: #8b687d; font-size: 12pt; font-family: arial, helvetica, sans-serif; visibility: visible; display: block; position: relative; z-index: 1; top: 120px; left: 190px; width: 620px; height: 460px;">
<iframe src="frame.html" name="frame" border="0" frameborder="0" height="460" width="620"></iframe>
<div id="layer2" style="position: absolute; top: 400px; left: 24px; width: 201px; height: 130px; z-index: 1;"><iframe src="nav.html"></iframe></div>
<div id="layer3" class="disclaimer" style="position: absolute; top: 580px; left: 300px; width: 459px; height: 40px; z-index: 1; text-align: center;"></div>