Center table vertically & horizontally??

Aperture

macrumors 68000
Original poster
Mar 19, 2006
1,877
0
PA
Hi. So, I got my one problem solved in the another thread, but still have one thing. I made my website in Photoshop CS2 & ImageReady and I believe ImageReady exported the site as one big table of images. I looked at the HTML, and added the <center></center> tags to center the table horizontally. To get the page roughly in the center vertically, I added 5 <br> tags before the table. Now i'm wondering if there is a real tag or code to center the thing vertically so it is dead center on the page. The reason I want to do this is, I realized just the <br> tags would look different on different size displays. Can anyone help?

Thanks
 

Kunimodi

macrumors member
Sep 8, 2006
65
0
Ashland, OR, USA
schaef2493 said:
Hi. So, I got my one problem solved in the another thread, but still have one thing. I made my website in Photoshop CS2 & ImageReady and I believe ImageReady exported the site as one big table of images. I looked at the HTML, and added the <center></center> tags to center the table horizontally. To get the page roughly in the center vertically, I added 5 <br> tags before the table. Now i'm wondering if there is a real tag or code to center the thing vertically so it is dead center on the page. The reason I want to do this is, I realized just the <br> tags would look different on different size displays. Can anyone help?
Thanks
Hi, schaef2493. Use percentage for the vertical size (e.g. 100%) and center alignment.
 

Coolnat2004

macrumors 6502
Jan 12, 2005
478
3
If you need to keep the main table the same size, you can do something like this (tables suck, but it works):

PHP:
<html>
<body>

<table cellpadding="0" cellspacing="0" border="0" align="center" width="100%" height="100%">
<tr><td align="center" valign="middle">

<!-- Main table that will be centered -->
    <table align="center">
    </table>
<!-- END main table that will be centered -->

</td></tr>
</table>

</body>
</html>