473,386 Members | 1,886 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

help with position

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
4 1611
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
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
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
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Mike | last post by:
Hey guys I need some help with updateing an access database. I used OleDB controls to set up my connection, adapter, and dataset. The access table I am trying to update has these columns in this...
4
by: Kain0o0 | last post by:
Hello , thanks for any help in advance. Im writing some code for a c++ class and the proffessor wants us to implement a list template using arrays. I thought this would be an easy task but have...
2
by: Jackson Yap | last post by:
can someone kind enough to help me look at the attached html and js file? Why is it that the javascript menu could not work at www.apchosting.net but could work at...
1
by: phoenix1215 | last post by:
I need to make a script that will calculate the moon phase based on the moon's position... it's for an online game here's what I've got - members locate the position by viewing the page source and...
0
by: crisscross27 | last post by:
Hi, I found a page called "myflashfetish" where you chan choose mp3 players for my space, well the problem is this, I wanted to place 2 or more players in myspace in a particular place, I read...
2
by: tonsi | last post by:
I have a page but it wont center the div. Can anyone take a look at it and help. When I try to center in the body using text-align: center; it doesn't work with the main container (called Table_01)....
3
by: BlueroY | last post by:
hi, I'm working on an exercise, i did a lot of work already and i just can't figure where I'm going wrong, this is what I'm trying to achieve Sample IO...
2
by: registry | last post by:
<%@Language="VBSCRIPT" CODEPAGE="1252"%> <html> <head> <title>Registry Network Hospital Detail</title> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> <script...
8
by: manugm1987 | last post by:
<?xml-stylesheet type="text/xsl" href="ch1.xsl"?> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/> <style type="text/css"> span.cls_002{...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.