Closed Thread
Results 1 to 3 of 3

Thread: HTML table vertical aligning problem

  1. #1
    Carrym is offline Newbie
    Join Date
    Mar 2007
    Posts
    3
    Rep Power
    0

    HTML table vertical aligning problem

    When posting code please use code tags. There are PHP, HTML and CODE tags that can be used while posting code segments.

    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!

    HTML Code:
    <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>
    When posting code please use code tags. There are PHP, HTML and CODE tags that can be used while posting code segments.
    Last edited by John; 03-22-2007 at 08:01 PM.

  2. CODECALL Circuit advertisement
    Join Date
    Always
    Posts
    Many

     
  3. #2
    McZika is offline Newbie
    Join Date
    Mar 2007
    Posts
    1
    Rep Power
    0
    The text IS displayed in the center of the field. (try changing the border to 1 and you will see for yourself )

    the problem is with the picture. The pic is displayed in the top left corner of the cell, and because of all the hidden input tags there is some white space below the picture and because of it it seems like the texk is on the bottom of the imege.

    So either remove the hidden input tags, or try messing with the styles...

  4. #3
    Join Date
    Jul 2006
    Location
    Amherst, New York, United States
    Posts
    6,277
    Blog Entries
    26
    Rep Power
    20
    Quote Originally Posted by McZika View Post
    The text IS displayed in the center of the field. (try changing the border to 1 and you will see for yourself )

    the problem is with the picture. The pic is displayed in the top left corner of the cell, and because of all the hidden input tags there is some white space below the picture and because of it it seems like the texk is on the bottom of the imege.

    So either remove the hidden input tags, or try messing with the styles...
    Im not sure it has anything to do with the hidden inputs or forms. If you try with just an image, with out any forms, it still behaves the same way.

    Just out of curiosity, is there a reason you CANT use a table?

Closed Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. php Array to html table
    By rushhh in forum PHP Development
    Replies: 7
    Last Post: 05-18-2011, 07:13 AM
  2. Aligning problem.
    By k4m1k4z1 in forum JavaScript and CSS
    Replies: 2
    Last Post: 06-13-2010, 11:34 AM
  3. Problem with UPDATE a field in the mySQL table
    By Thevenin in forum PHP Development
    Replies: 7
    Last Post: 04-27-2010, 09:16 AM
  4. Aligning JComponents
    By ClemsonCS in forum Java Help
    Replies: 3
    Last Post: 04-14-2009, 11:05 PM
  5. Relational Database to HTML Table
    By millsy007 in forum PHP Development
    Replies: 1
    Last Post: 02-09-2009, 05:20 PM

Tags for this Thread

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