Cannot center table

Discussion in 'HTML & Website Design' started by Pandemix, Aug 30, 2007.

  1. #1
    Hello,

    I am working on a site and I need to put a table at the bottom, but I can't align it with the table above it, as shown in this screenshot:

    [​IMG]

    I have tried putting margin in the CSS, then I tried using it in the table (style="..") but it will not budge. I did the same with padding. I need to move it over a few pixels to the left so it aligns with the black bar above it.
     
    Pandemix, Aug 30, 2007 IP
  2. twistedspikes

    twistedspikes Notable Member

    Messages:
    5,694
    Likes Received:
    293
    Best Answers:
    0
    Trophy Points:
    280
    #2
    whats the site?
     
    twistedspikes, Aug 30, 2007 IP
  3. it career

    it career Notable Member

    Messages:
    3,562
    Likes Received:
    155
    Best Answers:
    0
    Trophy Points:
    270
    #3
    Align all entries to the left
     
    it career, Aug 30, 2007 IP
  4. PHPGator

    PHPGator Banned

    Messages:
    4,437
    Likes Received:
    133
    Best Answers:
    0
    Trophy Points:
    260
    #4
    it career is correct, if you want the text to align, then you have to take out align=center in your columns for the fields at the top.

    The ones at the bottom don't have an alignment set, or if they do, it is set to left.
     
    PHPGator, Aug 30, 2007 IP
  5. Pandemix

    Pandemix Well-Known Member

    Messages:
    954
    Likes Received:
    29
    Best Answers:
    0
    Trophy Points:
    120
    #5
    Pandemix, Aug 30, 2007 IP
  6. DominoBB

    DominoBB Peon

    Messages:
    48
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    0
    #6
    You have a pronlem in your css file. You set a negative margin to the table in the left side so naturaly the table will show up in a different place than the other content.

    Here is what you have to do:
    In #content {
    set padding: 20px;

    In .tableborder {
    set margin-left: 0px;
     
    DominoBB, Aug 30, 2007 IP
  7. Pandemix

    Pandemix Well-Known Member

    Messages:
    954
    Likes Received:
    29
    Best Answers:
    0
    Trophy Points:
    120
    #7
    Now they're aligned, but they're both not in the middle of the content box. They're' more to the right.

    I have it set now to what you said.
     
    Pandemix, Aug 30, 2007 IP
  8. DominoBB

    DominoBB Peon

    Messages:
    48
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    0
    #8
    You forgot to change this #content {
     
    DominoBB, Aug 30, 2007 IP
    Pandemix likes this.
  9. Pandemix

    Pandemix Well-Known Member

    Messages:
    954
    Likes Received:
    29
    Best Answers:
    0
    Trophy Points:
    120
    #9
    Thanks so much Domino! Rep +

    Edit: Is there any way to put spaces between the tables? Like, I want those 3 tables at the bottom separated by 2 pixels. Anyway to do that?
     
    Pandemix, Aug 30, 2007 IP
  10. DominoBB

    DominoBB Peon

    Messages:
    48
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    0
    #10
    If you are referring to the three boxes named "recent work","client testimonials" and "hire me" than those aren't three tables that is actually a single table with multiple cells.
    If you want them separated than you should make different divs. You can also try <table border="0" bordercolor="#0496c6" cellpadding="0" cellspacing="2" width="562"> for the table but it's not the same effect.
     
    DominoBB, Aug 30, 2007 IP
  11. Pandemix

    Pandemix Well-Known Member

    Messages:
    954
    Likes Received:
    29
    Best Answers:
    0
    Trophy Points:
    120
    #11
    So how could I align 3 divs in the place of the table? I tried using the divs for the 3 boxes, but they would not go next to each other, but below each other.

    How would I align them next to each other by using divs and css with no tables then?
     
    Pandemix, Aug 30, 2007 IP