On 2006-10-16, need help <js@js.comwrote:
hi. i have a table that is aligned center on the page and is 600px wide. i
now want to position a thin div (layer?) on the page so that it butts up
against the left side of the table (so this layer will be on the outside of
the table) and it should move relative to the table so that it stays lined
up with the table. is this something i can do?
Put the table in a centered div instead.
Then put the thin div inside that div, absolutely position it, and set
left to make it stick out to the left.
<html>
<head>
<style type="text/css">
div#tableContainer
{
margin-left: auto;
margin-right: auto;
width: 600px;
position: relative;
}
table
{
background-color: green;
width: 100%;
}
div#ads
{
width: 100px;
border: 2px solid black;
position: absolute;
left: -104px;
}
</style>
</head>
<body>
<div id="tableContainer">
<div id="ads">
Why not buy one of these?
</div>
<table>
<td>
blah blah
</td>
</table>
</div>
</body>
</html>