valign image in table cell?

Discussion in 'HTML' started by harry, May 5, 2004.

  1. harry

    harry Guest

    Using IE 5.5 (sp2)

    I have an image 21 pixels in height that I want next to a text field (which
    sizes to 22px) with a table cell.

    I'm trying to get the image to centre vertically in the cell but whatever I
    try it makes no difference, the image is stuck in the top left corner of the
    cell making it look odd as the text field is several pixels lower down.

    I've tried putting it in separate cell, using div's but still no difference!

    Is this possible?

    thanks

    harry
     
    harry, May 5, 2004
    #1
    1. Advertisements

  2. harry

    Els Guest

    harry wrote:

    > Using IE 5.5 (sp2)
    >
    > I have an image 21 pixels in height that I want next to a text field (which
    > sizes to 22px) with a table cell.
    >
    > I'm trying to get the image to centre vertically in the cell but whatever I
    > try it makes no difference, the image is stuck in the top left corner of the
    > cell making it look odd as the text field is several pixels lower down.
    >
    > I've tried putting it in separate cell, using div's but still no difference!


    I think posting a url would help a lot, as a table cell
    already centers the content vertically by default...

    --
    Els
    http://locusmeus.com/
    Sonhos vem. Sonhos vão. O resto é imperfeito.
    - Renato Russo -
     
    Els, May 5, 2004
    #2
    1. Advertisements

  3. harry

    Hywel Guest

    In article <9U4mc.2326$>, harry
    says...
    > Using IE 5.5 (sp2)
    >
    > I have an image 21 pixels in height that I want next to a text field (which
    > sizes to 22px) with a table cell.
    >
    > I'm trying to get the image to centre vertically in the cell but whatever I
    > try it makes no difference, the image is stuck in the top left corner of the
    > cell making it look odd as the text field is several pixels lower down.
    >
    > I've tried putting it in separate cell, using div's but still no difference!
    >
    > Is this possible?


    No. To valign a 21 pixel high image you'll need a text field that's 23
    pixels high. With a 21px high field you'll either hat the image aligned
    to the top with 1 pixel and the bottom, or aligned at the bottom with 1
    pixel at the top. You need an even number of pixels difference between
    the height of two objects.

    A URL would be useful.


    --
    Hywel I do not eat quiche
    http://kibo.org.uk/
    http://kibo.org.uk/mfaq.php
     
    Hywel, May 5, 2004
    #3
    1. Advertisements

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Mark Goldin

    Table in a cell of another table

    Mark Goldin, Aug 19, 2004, in forum: ASP .Net
    Replies:
    2
    Views:
    431
    Mark Goldin
    Aug 19, 2004
  2. Sean Jorden
    Replies:
    1
    Views:
    748
    laurie
    Aug 19, 2003
  3. Phillip Roncoroni
    Replies:
    14
    Views:
    1,384
    Toby A Inkster
    Apr 5, 2004
  4. Poddys
    Replies:
    5
    Views:
    2,033
    Poddys
    Oct 25, 2006
  5. sdf
    Replies:
    3
    Views:
    2,451
  6. legacy

    valign text and image

    legacy, Mar 26, 2008, in forum: HTML and CSS
    Replies:
    0
    Views:
    581
    legacy
    Mar 26, 2008
  7. Symphony

    add hyber link to table or table cell web control

    Symphony, Mar 15, 2005, in forum: ASP .Net Web Controls
    Replies:
    1
    Views:
    599
    Ken Cox [Microsoft MVP]
    Mar 16, 2005
  8. Replies:
    7
    Views:
    363
    Lasse Reichstein Nielsen
    Jul 11, 2005
Loading...