Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

Welcome to the new platform of Programmer's Heaven! We apologize for the inconvenience caused, if you visited us from a broken link of the previous version. The main reason to move to a new platform is to provide more effective and collaborative experience to you all. Please feel free to experience the new platform and use its exciting features. Contact us for any issue that you need to get clarified. We are more than happy to help you.

How to vertically align an image?

d faderd fader Posts: 247Member
Hi,

I've been trying to vertically align an image in a table cell. This may sound easy but I want to to work in both IE and Firefox.

My problem: I have a tablerow with two cells, the first cells contains some text (will never wrap), the second cell contains a 16x16 image. I want this image vertically aligned in the tablecell (18px high). It works fine in Firefox, but in IE the tablerow is rendered 19px high instead of 18px. Here's my HTML code:

<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">



Image test








Title

test image


[blue][b][italic],-~[ D-FADER ]~-'[/italic][/b][/blue]

Comments

  • mac_doggiemac_doggie Posts: 488Member
    : Hi,
    :
    : I've been trying to vertically align an image in a table cell. This may sound easy but I want to to work in both IE and Firefox.
    :
    : My problem: I have a tablerow with two cells, the first cells contains some text (will never wrap), the second cell contains a 16x16 image. I want this image vertically aligned in the tablecell (18px high). It works fine in Firefox, but in IE the tablerow is rendered 19px high instead of 18px. Here's my HTML code:
    :
    : <?xml version="1.0" encoding="iso-8859-1"?>
    : <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    :
    :
    :
    : Image test
    :
    :
    :
    :
    :
    :
    :
    :
    :

    : Title
    :

    : test image
    :
    :
    :
    : [blue][b][italic],-~[ D-FADER ]~-'[/italic][/b][/blue]
    :
    You can try
    or you can try to adjust the line-height, and make sure something else besides the image is in the td, just add a  
    ;-)
    -mac-
    mailto:mac_doggie@hotmail.com
    the Netherlands...


Sign In or Register to comment.