Results 1 to 3 of 3

Thread: Dynamically Change the valign of a <td>

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    May 2002
    Posts
    142

    Dynamically Change the valign of a <td>

    Hey all,
    I am tring to dynamically change the vertical alignment of a <td> but am running into trouble:

    <TD id="link5" name="link5" BGCOLOR="#000259">

    <select name="valignleft" size="1" OnChange="window.document.all['link5'].valign='bottom' ">
    <option value="top">Top</option>
    <option value="middle">Middle</option>
    <option value="Bottom">Bottom</option>
    </select>

    I can get this to work with background color and other things, but not with valign. I've tried verticalalign, and textalign to no avail! Any help would be appreciated.
    Thanks
    Bebandit

  2. #2
    Frenzied Member Rick Bull's Avatar
    Join Date
    Apr 2002
    Location
    England
    Posts
    1,444
    I would use style instead. This will work cross-browser too by the way (document.all is IE only I think):

    Code:
    <table><tr>
      <td style="vertical-align:bottom;" id="c1" onclick="document.getElementById('c1').style.verticalAlign = 'top';">asdasdasda</td>
      <td valign="top">asdasdasda<br>asdasdasdasdasda<br>asdasdasdasdasda<br>asdasd</td>
    </tr></table>

  3. #3

    Thread Starter
    Addicted Member
    Join Date
    May 2002
    Posts
    142

    Thanks!!

    Thanks!!!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width