A or B

Discussion in 'HTML & Website Design' started by oo7ml, Aug 2, 2007.

  1. #1
    My page consists of a table that is 760px wide. I want to center the page.

    Should i do A or B

    A: center the table (table width="760" align="center")

    B: put a DIV around the table and center that) (<div align="center">
     
    oo7ml, Aug 2, 2007 IP
  2. sawz

    sawz Prominent Member

    Messages:
    8,225
    Likes Received:
    808
    Best Answers:
    0
    Trophy Points:
    360
    #2
    i'm lazy so i would just center it without a div

    but thats me. :D
     
    sawz, Aug 2, 2007 IP
  3. revdesigner

    revdesigner Peon

    Messages:
    42
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #3
    I use div's alot so i'd say go with div
     
    revdesigner, Aug 2, 2007 IP
  4. AstarothSolutions

    AstarothSolutions Peon

    Messages:
    2,680
    Likes Received:
    77
    Best Answers:
    0
    Trophy Points:
    0
    #4
    What is in the table?

    It sounds like you are using a table to define the layout of the page, if this is the case then you should go for C - redesign without using tables

    If you are talking about displaying tabular data on the page rather than using a table to define structure why on earth would you nest it inside a div? Divs are now being used as badly as tables used to be and are just as poor for accessibility as nested tables.
     
    AstarothSolutions, Aug 3, 2007 IP
  5. Stomme poes

    Stomme poes Peon

    Messages:
    3,195
    Likes Received:
    136
    Best Answers:
    0
    Trophy Points:
    0
    #5
    But if you DO decide to keep your tables (tho I second Astaroth's suggestion), the simple margin-left:auto; margin-right:auto should work... as deathshadow showed to me here : )

    This will put an equal amount of marginspace on each side of your table.
     
    Stomme poes, Aug 3, 2007 IP
  6. chicomalo

    chicomalo Guest

    Messages:
    116
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #6
    Center it without a Div if you are not going to use CSS for the time being.
     
    chicomalo, Aug 3, 2007 IP
  7. PHPGator

    PHPGator Banned

    Messages:
    4,437
    Likes Received:
    133
    Best Answers:
    0
    Trophy Points:
    260
    #7
    If you are designing the majority of your site in tables, use align="center". The only reason you would use a div here is if you were going to go with a tableless design. :)
     
    PHPGator, Aug 3, 2007 IP
  8. Rastaman

    Rastaman Active Member

    Messages:
    15
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    53
    #8
    I would use div instead of table and define it in css with margin-left:auto; margin-right:auto; like Stomme poes already said.
    That's both simple and efficient.
     
    Rastaman, Aug 3, 2007 IP
  9. eadkung

    eadkung Active Member

    Messages:
    148
    Likes Received:
    6
    Best Answers:
    0
    Trophy Points:
    58
    #9
    i'll use div without table. that make your site downloaded faster.
     
    eadkung, Aug 4, 2007 IP