November 20th, 2003, 10:19 AM
Positioning with CSS
I have a table not long enough to fill the page. I want the table to always be in the middle of the page at no matter what resolution. I know that for text I could just have <td valign="middle"> but how can I do the same but for a table using CSS? Is there a variable where I can check the size of the screen and align it that way?
November 20th, 2003, 01:16 PM
try either the position:relative or postion:absolute positioners.
Ryan Jones (RyanJ)
November 20th, 2003, 04:19 PM
Look here for an example of centering a <div> horizontally and vertically in the window. Use the div as a container for your page. This little exercise is not pure CSS, it uses a single cell table as the outer container. I generally don't use tables for layout, but if you want vertical centering, this seems to be the only elegant hack.
There are those who manage to build a web site without knowing what they're doing; thereby proving to themselves they do, indeed, know what they're doing.
My html and css workshop
, demos and tutorials.
Ask a better question
, get a better answer.
November 21st, 2003, 07:26 AM
Thanks in a million! I surely appreciated you sharing your knowledge.