By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,988 Members | 1,017 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,988 IT Pros & Developers. It's quick & easy.

help with position

P: n/a
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?
Oct 16 '06 #1
Share this Question
Share on Google+
4 Replies


P: n/a
On Mon, 16 Oct 2006 14:17:24 -0400, "need help" <js@js.comwrote:
>i have a table that is aligned center on the page and is 600px wide.
Well you'd probably best start by correcting that then. See
http://www.xs4all.nl/~sbpoley/webmat...lexdesign.html or any of the
other pages on the subject that have been referred to here frequently.
(My excuses if you actually have a good reason for a 600px table, but
that would be a rare occurrence.)
>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?
It might help if we knew what the DIV was *for*. Are you talking about a
menu, a border, a decorative image ...?

--
Stephen Poley

http://www.xs4all.nl/~sbpoley/webmatters/
Oct 16 '06 #2

P: n/a
thanks.
its actually a client site and unfortunatley must stay as is as far as
overall design.
he will be rotating advertising in a long vertical "box" and the only good
place to put it is ouside of, but next to the existing table.
any thoughts?

"Stephen Poley" <sb******************@xs4all.nlwrote in message
news:16********************************@4ax.com...
On Mon, 16 Oct 2006 14:17:24 -0400, "need help" <js@js.comwrote:
>>i have a table that is aligned center on the page and is 600px wide.

Well you'd probably best start by correcting that then. See
http://www.xs4all.nl/~sbpoley/webmat...lexdesign.html or any of the
other pages on the subject that have been referred to here frequently.
(My excuses if you actually have a good reason for a 600px table, but
that would be a rare occurrence.)
>>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?

It might help if we knew what the DIV was *for*. Are you talking about a
menu, a border, a decorative image ...?

--
Stephen Poley

http://www.xs4all.nl/~sbpoley/webmatters/

Oct 16 '06 #3

P: n/a
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>
Oct 16 '06 #4

P: n/a
very nice, thank you!
"Ben C" <sp******@spam.eggswrote in message
news:sl*********************@bowser.marioworld...
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>

Oct 17 '06 #5

This discussion thread is closed

Replies have been disabled for this discussion.