Results 1 to 2 of 2

Thread: HTML table vertical aligning problem

  1. #1
    Join Date
    Feb 2007
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default HTML table vertical aligning problem

    Hey,
    I am trying to get the text in the second cell of this HTML table to be centered vertically in the middle of the the image in the first cell. See the code. For some reason the text is always positioned at the bottom of the cell! Sorry for all the encrypted stuff, but this is how I can replicate this problem. Basically I want the text 'Sample Text' to be properly vertically aligned. valign="middle" is not working!

    <table width="90%" border="0" cellspacing="0" cellpadding="0">
    <tr valign="middle">
    <td width="20%"><form action="https://www.paypal.com/cgi-bin/webscr" method="post">
    <input type="hidden" name="cmd" value="_s-xclick">
    <input type="image" src="https://www.paypal.com/en_US/i/btn/x-click-butcc.gif" border="0" name="submit" alt="Make payments with PayPal - it's fast, free and secure!">
    <img alt="" border="0" src="https://www.paypal.com/en_US/i/scr/pixel.gif" width="1" height="1">
    <input type="hidden" name="encrypted" value="-----BEGIN PKCS7-----MIIHiAY (...) PKCS7-----">
    </form></td>
    <td>Sample Text</td>
    </tr>
    </table>

    _________________
    Penile enhancement Heart attack symptoms

  2. #2
    Join Date
    Sep 2005
    Location
    India
    Posts
    1,627
    Thanks
    6
    Thanked 107 Times in 107 Posts

    Default

    Try the following code and see the result

    Code:
    <table width="90%" border="0" cellspacing="0" cellpadding="0">
    <form action="https://www.paypal.com/cgi-bin/webscr" method="post">
    <tr>
    <td width="10%" valign="middle">
    <input type="hidden" name="cmd" value="_s-xclick">
    <input name="submit" type="image" src="https://www.paypal.com/en_US/i/btn/x-click-butcc.gif" alt="Make payments with PayPal - it's fast, free and secure!" align="middle" border="0">
    <img alt="" border="0" src="https://www.paypal.com/en_US/i/scr/pixel.gif" width="8" height="8" align="middle">
    <input type="hidden" name="encrypted" value="-----BEGIN PKCS7-----MIIHiAY (...) PKCS7-----">
    </td>
    <td valign="middle">Sample Text</td>
    </tr>
    </form>
    </table>

Bookmarks

Posting Permissions

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