html table question

Discussion in 'HTML & Website Design' started by BuLLeTz, May 4, 2008.

  1. #1
    I have a question with html tables. I included a picture so its easier for me to explain it.

    [​IMG]

    Using the basic <td> coding, what can I add to it so the "I want this text to be at the top" actually be at the top (where the arrows are pointing).

    Thanks for the help.
     
    BuLLeTz, May 4, 2008 IP
  2. Dealhunter

    Dealhunter Active Member

    Messages:
    371
    Likes Received:
    4
    Best Answers:
    0
    Trophy Points:
    58
    #2
    I dont know exactly what you are looking for but I hope this helps. John


    <table width="200" border="1" cellpadding="0" cellspacing="0">
    <tr>
    <td width="183"><p>I want this text to be at the top</p>
    <p>Test</p>
    <p>Test</p>
    <p>Test</p>
    <p>Test</p>
    <p>Test</p>
    <p>Test</p>
    </td>
    </tr>
    </table>
     
    Dealhunter, May 4, 2008 IP
  3. BuLLeTz

    BuLLeTz Active Member

    Messages:
    208
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    53
    #3
    No. I want "I want this text to be at the top" to be at the top right next to the "text".

    i was thinking along the lines of <td align="top"> but that doesnt work.
     
    BuLLeTz, May 4, 2008 IP
  4. Colbyt

    Colbyt Notable Member

    Messages:
    3,224
    Likes Received:
    185
    Best Answers:
    0
    Trophy Points:
    210
    #4
    I think valign is what you are looking for:

     
    Colbyt, May 4, 2008 IP
    BuLLeTz likes this.
  5. kk5st

    kk5st Prominent Member

    Messages:
    3,497
    Likes Received:
    376
    Best Answers:
    29
    Trophy Points:
    335
    #5
    In the stylesheet, set td {vertical-align: top;}. The default value is middle.

    cheers,

    gary
     
    kk5st, May 4, 2008 IP
  6. Aaron700

    Aaron700 Active Member

    Messages:
    338
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    53
    #6
    <table>
    <tr>
    <td>Test</td>
    <td>I want this at the top</td>
    </tr>
    <tr>
    <td>Test</td>
    </tr>
    <tr>
    <td>Test</td>
    </tr>
    <tr>
    <td>Test</td>
    </tr>
    <tr>
    <td>Test</td>
    </tr>
    <tr>
    <td>Test</td>
    </tr>
    </table>

    I think might work.
     
    Aaron700, May 4, 2008 IP
  7. godisgood

    godisgood Banned

    Messages:
    79
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #7
    valign="top"
     
    godisgood, May 5, 2008 IP
  8. whittier

    whittier Active Member

    Messages:
    43
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    71
    #8
    BuLLeTz,

    In your original code, you did not specify rows. I believe that Aaron700 gave you the correct solution.

    "I want this text to be at the top" is in the 2nd column of the first row.
     
    whittier, May 5, 2008 IP
  9. 007c

    007c Peon

    Messages:
    611
    Likes Received:
    11
    Best Answers:
    0
    Trophy Points:
    0
    #9
    Just wanted to day that's ineficient when a simple valign or css class with vertical align will do.. plus what happens if u add a second line to test.
     
    007c, May 5, 2008 IP