How do I center my table for all screen resolutions?

Discussion in 'JavaScript and AJAX' started by reese24, May 31, 2009.

  1. reese24

    reese24 New Member

    Joined:
    May 31, 2009
    Messages:
    1
    Likes Received:
    0
    Trophy Points:
    0
    Hi. I have been trying to center the table of a website i'm working on, but the 'ol align="center" doesn't work for all screen resolutions. Can anyone help me please?




    Thanks xx
     
  2. shabbir

    shabbir Administrator Staff Member

    Joined:
    Jul 12, 2004
    Messages:
    15,375
    Likes Received:
    388
    Trophy Points:
    83
    You submitted this question in Articles and I have moved it to forum for discussion and also if you would like to align to vertical center or horizontal center is not clear but I would try to explain both.

    For Horizontal center you can use align:center as a style but for vertical center you have to use Javascript to get the height and then position accordingly or even try valign:middle but that would mean you need
     
  3. gkumar

    gkumar New Member

    Joined:
    Jun 16, 2009
    Messages:
    58
    Likes Received:
    5
    Trophy Points:
    0
    If you're using frames you might wanna keep the website on 800x600 entirly so you won't be able to use the standard <center> or <div align="center"> tags..

    instead you could place the whole page in a frameset:
    Code:
    <framset rows="*,600,*" border="0">
    <frame src="blank.html" scrolling="no">
    <frameset cols="*,800,*" border="0">
    <frame src="blank.html" scrolling="no">
    <frame src="your main page.html" scrolling="no">
    <frame src="blank.html" scrolling="no">
    </frameset>
    <frame src="blank.html" scrolling="no">
    </frameset>
    do keep in mind your website isn't 800x600, infact it'll be around 796x500 or even less... find a middleground and you'll be set to go... do create the blank html page, either in the website background or completely different color, whatever you like...

    Personally I wouldn't recommend doing your page like this but it would work... I'd try to get a page to work in all resolutions and if that doesn't work, do it for 1024x768 because I think that's being used to most nowadays
     

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice