SitePoint Sponsor

User Tag List

Results 1 to 8 of 8
  1. #1
    SitePoint Wizard silver trophy redemption's Avatar
    Join Date
    Sep 2001
    Location
    Singapore
    Posts
    5,269
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    centering a table vertically on page?

    ok this should be simple but i just can't get it...

    how do you center a table both horizontally and vertically on a page?... i know how to center it horizontally by placing it within <div align="center"> </div> tags but is there a 'clean' way to do it, using css or a tag attribute, or do i have to resort to something like a placeholder table or several &nbsp; ?

    thanks

  2. #2
    Net Senior Citizen tommatthews's Avatar
    Join Date
    Apr 2001
    Location
    Sydney Australia
    Posts
    869
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    You could put a table within a table and set the cell like this:

    <table><tr><td valign="center" align="center">
    <table><tr><td>

    content here

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


    affordable website design

    :: sydney australia ::

  3. #3
    SitePoint Wizard silver trophy redemption's Avatar
    Join Date
    Sep 2001
    Location
    Singapore
    Posts
    5,269
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    thanks tom!

    that worked after i set the outer table's height attribute to 100% but it got me going

  4. #4
    Net Senior Citizen tommatthews's Avatar
    Join Date
    Apr 2001
    Location
    Sydney Australia
    Posts
    869
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Oh yea, I forgot that bit. Glad you figured it out.


    affordable website design

    :: sydney australia ::

  5. #5
    long gone but not forgotten AljapaCo's Avatar
    Join Date
    Aug 2001
    Location
    Sweden
    Posts
    548
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    You could use css for positioning as well!!
    T O B I A S - S T R A N D H | visit my site here
    OPERA7 /MSIE6 /FireFox 1.1/Win2000 /ADSL /17" Screen /1024x768
    god doesn't create genius, he clones me.............

  6. #6
    Net Senior Citizen tommatthews's Avatar
    Join Date
    Apr 2001
    Location
    Sydney Australia
    Posts
    869
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    And that code is.....???


    affordable website design

    :: sydney australia ::

  7. #7
    .net install meltdown
    Join Date
    May 2001
    Location
    View Ridge
    Posts
    692
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Here's some info on a CSS approach: http://bluerobot.com/web/css/center1.html.

  8. #8
    Net Senior Citizen tommatthews's Avatar
    Join Date
    Apr 2001
    Location
    Sydney Australia
    Posts
    869
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    It doesnt sound very compatible with many browsers unfortunetly.
    Anyone else have a better way of doing this with css?


    affordable website design

    :: sydney australia ::


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •