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!
When posting code please use code tags. There are PHP, HTML and CODE tags that can be used while posting code segments.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>
Last edited by John; 03-22-2007 at 08:01 PM.
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...
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks