Center table vertically & horizontally??

Discussion in 'Web Design and Development' started by Aperture, Oct 1, 2006.

  1. Aperture macrumors 68000

    Aperture

    Joined:
    Mar 19, 2006
    Location:
    PA
    #1
    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
     
  2. puckhead193 macrumors G3

    puckhead193

    Joined:
    May 25, 2004
    Location:
    NY
    #2
    i can't help you out but i do like your design for the homepage
     
  3. Aperture thread starter macrumors 68000

    Aperture

    Joined:
    Mar 19, 2006
    Location:
    PA
    #3

    Thanks.:)
     
  4. Kunimodi macrumors member

    Joined:
    Sep 8, 2006
    Location:
    Ashland, OR, USA
    #4
    Hi, schaef2493. Use percentage for the vertical size (e.g. 100%) and center alignment.
     
  5. Coolnat2004 macrumors 6502

    Coolnat2004

    Joined:
    Jan 12, 2005
    #5
    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>
     

Share This Page