table aligning with css

windows

Guest
Is it possible to align a table, or anyother object for that matter, vertically in the middle? I'm going to make a page that's not going to be more than 800x600. So, i want to vertically align my table with all the content in in the center of the window, even if the resoltuion is changed to lets say 1024x768. Is this possible with css.
Thanksposition:absolute;left:50%;top:50%;Originally posted by minulescu
Is it possible to align a table, or anyother object for that matter, vertically in the middle?

Only if you know it's exact height & width, (unless it's a background image).

eg
position:absolute;left:50%;top:50%; width:200px; height:300px; margin:-150px 0 0 -100px;


BTW, you shouldn't be using <table> for creating general layout in the first place.I know i shouldnt be using table for alignment, but i dunno too much about css, so I'm gonna "abuse" tables, like U usually say Stefan :) . I know i shouldnt but hey, what can I do. I'm gonna use what I can and know how to use. I have one question tho. If u set the margin, like you did above, is that only for the item/object specified?? or does it change my whole page to that margin?
ThanksOriginally posted by minulescu
. I have one question tho. If u set the margin, like you did above, is that only for the item/object specified??

Yes, you want to specify it for the specific object you want to center.
 
Back
Top