[thelist] Vertically Centering Tables

Erik Mattheis gozz at gozz.com
Mon Feb 17 13:25:02 CST 2003


On Monday, February 17, 2003, at 12:42  PM, Nebula wrote:
> Hello.  I'm making a webpage where the content should be in the middle
> of the browser viewing area (centered vertically and horizontally).  I
> am trying to keep this standards compliant.

No way to achieve it in older browsers without JS or height="100%", but

<table style="height:100%; width:100%">
<tr>
<td style="text-align:center">
content
</td>
</tr>
</table>

will likely work nicely for you.

If you decide that it's more important that your page look as you
intend in the greatest numbers of browsers possible than in someone's
validator,

<table width="100%" height="100%"  style="height:100%; width:100%" >
<tr>
<td align="center" style="text-align:center" >
content
</td>
</tr>
</table>

... is probably your best shot.
-----------------------
Erik Mattheis
GoZz Digital
<http://goZz.com/>
Flash and ColdFusion Development
Minneapolis, MN
-----------------------




More information about the thelist mailing list