table alggment

Discussion in 'HTML & Website Design' started by redhits, Dec 7, 2009.

  1. #1
    So i have a code like

    
      <table class=atable border=0px cellspacing=1 cellpadding=5>
          <tr>
          <td class=std>Country</td>
          <td class=std><font color=blue>Stock 1</font></td>
          <td class=std><font color=red>Stock 2</font></td>
          <td class=std><font color=green>Stock 3</font></td>
          </tr>
    
          </table>
          <table class=atable border=0px cellspacing=1 cellpadding=5>
          <tr>
          <td class=std>Country</td>
          <td class=std><font color=blue>Stock 1</font></td>
          <td class=std><font color=red>Stock 2</font></td>
          <td class=std><font color=green>Stock 3</font></td>
    
          </tr>
          </table>
          <table class=atable border=0px cellspacing=1 cellpadding=5>
          <tr>
          <td class=std>Country</td>
          <td class=std><font color=blue>Stock 1</font></td>
          <td class=std><font color=red>Stock 2</font></td>
    
          <td class=std><font color=green>Stock 3</font></td>
          </tr>
          </table>
          <table class=atable border=0px cellspacing=1 cellpadding=5>
          <tr>
          <td class=std>Country</td>
          <td class=std><font color=blue>Stock 1</font></td>
    
          <td class=std><font color=red>Stock 2</font></td>
          <td class=std><font color=green>Stock 3</font></td>
          </tr>
          </table>
    
    
    Code (markup):

    My problem is that this tables are loading like

    TABLE1
    TABLE2
    TABLE3

    I WANT THEM TO LOAD LIKE TABLE1 TABLE2 TABLE3, (ON THE SAME LINE)


    I've tried with some CSS like display:inline , or in float:left

    but both of them are fxxx the design :)
     
    Last edited by a moderator: Dec 7, 2009
    redhits, Dec 7, 2009 IP
  2. s_ruben

    s_ruben Active Member

    Messages:
    735
    Likes Received:
    26
    Best Answers:
    1
    Trophy Points:
    78
    #2
    Insert the tables in other table like this

    
        <table>
        <tr>
        <td>
          <table class=atable border=0px cellspacing=1 cellpadding=5>
          <tr>
          <td class=std>Country</td>
          <td class=std><font color=blue>Stock 1</font></td>
          <td class=std><font color=red>Stock 2</font></td>
          <td class=std><font color=green>Stock 3</font></td>
          </tr>
          </table>
        </td>
        <td>
          <table class=atable border=0px cellspacing=1 cellpadding=5>
          <tr>
          <td class=std>Country</td>
          <td class=std><font color=blue>Stock 1</font></td>
          <td class=std><font color=red>Stock 2</font></td>
          <td class=std><font color=green>Stock 3</font></td>
          </tr>
          </table>
        </td>
        <td>
          <table class=atable border=0px cellspacing=1 cellpadding=5>
          <tr>
          <td class=std>Country</td>
          <td class=std><font color=blue>Stock 1</font></td>
          <td class=std><font color=red>Stock 2</font></td>
          <td class=std><font color=green>Stock 3</font></td>
          </tr>
          </table>
        </td>
        <td>
          <table class=atable border=0px cellspacing=1 cellpadding=5>
          <tr>
          <td class=std>Country</td>
          <td class=std><font color=blue>Stock 1</font></td>
          <td class=std><font color=red>Stock 2</font></td>
          <td class=std><font color=green>Stock 3</font></td>
          </tr>
          </table>
        </td>
        </tr>
        </table>
    
    Code (markup):
     
    s_ruben, Dec 7, 2009 IP
  3. crazeann

    crazeann Peon

    Messages:
    36
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #3
    try float:left and set width to table 1: 30%, table 2 30% and table 3 30%
     
    crazeann, Dec 8, 2009 IP
  4. Piggy

    Piggy Active Member

    Messages:
    574
    Likes Received:
    9
    Best Answers:
    1
    Trophy Points:
    70
    #4
    As s_ruben said, putting them inside another table will work. Also, you can put them inside a div.

    Also, why not set a classes like:
    stdh
    std1
    std2
    std3
    etc.

    and for std1 set text color to blue inside the .css? It'd cut down on a bit of code. =)
     
    Piggy, Dec 8, 2009 IP
  5. coffeecup

    coffeecup Guest

    Messages:
    40
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #5
    coffeecup, Dec 8, 2009 IP
  6. mrpaisa

    mrpaisa Guest

    Messages:
    741
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #6
    There are two main ways you can align text in a cell, horizontally & vertically. there are three ways of aligning it for both of these. Horizontally, you can align it left, right & center. Vertically you can align it top, bottom & middle.
     
    mrpaisa, Jan 11, 2010 IP