Topic: Absolute Positioning (Page 1 of 1) Pages that link to <a href="https://ozoneasylum.com/backlink?for=10878" 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>\

 
Skatefx
Bipolar (III) Inmate

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

posted posted 12-14-2002 20:45

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 +

Bugimus
Maniac (V) Mad Scientist

From: New California
Insane since: Mar 2000

posted posted 12-17-2002 08:42

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.

http://www.bugimus.com/gurus/center_div.html

. . : slicePuzzle

DmS
Paranoid (IV) Inmate

From: Sthlm, Sweden
Insane since: Oct 2000

posted posted 12-17-2002 09:27

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) http://www.dmsproject.com/test/winTest.html

/Dan

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

H][RO
Bipolar (III) Inmate

From: Australia
Insane since: Oct 2002

posted posted 12-17-2002 23:08

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?

H][RO
Bipolar (III) Inmate

From: Australia
Insane since: Oct 2002

posted posted 12-17-2002 23:15

Pretty easy with CSS actually skate,

this goes withing your <head>

<style>
#myTable
{
top: 30px;
text-align: center;
}
</style>

then in your body

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


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:
 
Your Text:
Loading...
Options:


« BackwardsOnwards »

Show Forum Drop Down Menu