Topic: Absolute Positioning (Page 1 of 1) Pages that link to <a href="" title="Pages that link to Topic: Absolute Positioning (Page 1 of 1)" rel="nofollow" >Topic: Absolute Positioning <span class="small">(Page 1 of 1)</span>\

Bipolar (III) Inmate

From: Small Patch of Grass in CT
Insane since: Mar 2001

IP logged posted posted 12-14-2002 20:45 Edit Quote

I am looking to absolutly position an table in the center of my webpage. I am trying to do this because there is a picture I would like to position at the top of my table halfway in the table and halfway out of the table. I was wondering how I would go about aligning the horizontial axis to center and the vertical axis to a variable such as 30px from the top. Does anyone get what I am saying or is it too confusing?

+ Mike +

Maniac (V) Mad Scientist

From: New California
Insane since: Mar 2000

IP logged posted posted 12-17-2002 08:42 Edit Quote

Well, I personally don't know how to do it solely with CSS because I'm always too busy doing stuff with script. If you don't get a reply on how to do it with CSS then this demo page might help give you some ideas.

. . : slicePuzzle

Paranoid (IV) Inmate

From: Sthlm, Sweden
Insane since: Oct 2000

IP logged posted posted 12-17-2002 09:27 Edit Quote

Why must it be abslute center?
If you want it to look like it's centered in all resolutions, why not do it with relative positioning and percentages?
Take this for an example (just a quickie but it shows the thought)


{cell 260}
-{ a vibration is a movement that doesn't know which way to go }-

Bipolar (III) Inmate

From: Australia
Insane since: Oct 2002

IP logged posted posted 12-17-2002 23:08 Edit Quote

Would be pretty easy to just have a div with its contents set to center, the just put your table within those tags.

Personally i wouldnt use the percentage thing, when you resize your window it doesnt always seem to stay in the center, i think it takes the percentage from the left of your image? So this means it wont always be even.

Are you using CSS skate?

Bipolar (III) Inmate

From: Australia
Insane since: Oct 2002

IP logged posted posted 12-17-2002 23:15 Edit Quote

Pretty easy with CSS actually skate,

this goes withing your <head>

top: 30px;
text-align: center;

then in your body

<div ID="myTable">
<tr><td>Table Data Etc</td></tr>

That would be a really easy way to do it imo, if you keep your CSS simple too it should work in most browsers.

Anyhow i think thats what you were after let me know if im wrong ,hope it helps :0

Post Reply
Your User Name:
Your Password:
Login Options: Remember Me On This Computer
Your Text:
Options: Show Signature
Enable Slimies
Enable Linkwords

« BackwardsOnwards »

Show Forum Drop Down Menu