| | |
|
|
|
center table vertically |
| message from tanyavf on 21 Jul 2004 |
how do I center my page (or table) on my screen vertically? To center horizontally I use <centre>, is there a way to center vertically?
|
| Murray *TMM* replied to tanyavf on 21 Jul 2004 |
There is no such tag as <centre>. There is a deprecated tag, <center>, but
it's not the best way to get things centered in light of the amazing
capabilities of CSS.
To center a table vertically is much more difficult, but can be done -
See this discussion -
http://apptools.com/examples/tableheight.php
|
| tanyavf replied to Murray *TMM* on 21 Jul 2004 |
Thank you for your response! However, I don't think I was clear enough.
Here is an example of a site www.huffy.com. Their site in centred vert. &
Hor. If you change the size of the browser the page still remains centred. I
can't seem to find out how they did it. Any ideas?
|
| seb replied to tanyavf on 21 Jul 2004 |
Remove the doctype on the top of your page code, and use a table 100%
width and 100% height, then in the table, the <td> must be
align="center" valign="center".
Anything you place in that <td> will be vertically and horizontally
centered in the browser window.
This is "invalid" html, but it works in all browsers, contrary to the
"valid" techniques which don't work in all browsers (the CSS technique
does not work in IE5 Mac for example), javascrpit technique add 50 lines
of code and don't work in browsers with Javascript disabled.
Murray *TMM* wrote:
|
|
Archived message: center table vertically (Macromedia Dreamweaver)