Size of the table element does not satisfy the explicit settings.

Discussion in 'HTML' started by showandbeshown@gmail.com, Dec 6, 2007.

  1. Guest

    Hi,

    I define a table element (<td></td>) with the explicit values of the
    height and width (20x20 px). Than I put an image in this element which
    has the same size:
    <td rowspan="1" colspan="1" style="width: 20px; height: 20px;">
    <img src="img/l_t.php?int_col=e1e1e1" width="20" height="20" alt="" /
    ></td>


    As a result I see that my table element (<td></td>) is not square (as
    it is supposed to be). The hight is larger than width so that under
    the square image I see some empty space. Why it is happening? Does
    anybody have any idea?

    The whole XHTML code you can find on:
    http://www.showandbeshown.com/headtail.php

    Pleas help me if you can!
     
    , Dec 6, 2007
    #1
    1. Advertising

  2. wrote:
    > Hi,
    >
    > I define a table element (<td></td>) with the explicit values of the
    > height and width (20x20 px). Than I put an image in this element which
    > has the same size:
    > <td rowspan="1" colspan="1" style="width: 20px; height: 20px;">
    > <img src="img/l_t.php?int_col=e1e1e1" width="20" height="20" alt="" /
    >> </td>

    >
    > As a result I see that my table element (<td></td>) is not square (as
    > it is supposed to be). The hight is larger than width so that under
    > the square image I see some empty space. Why it is happening? Does
    > anybody have any idea?
    >
    > The whole XHTML code you can find on:
    > http://www.showandbeshown.com/headtail.php


    Add

    td img { display: block; }

    to your stylesheet should fix your problem... images are inline by
    default...


    --
    Take care,

    Jonathan
    -------------------
    LITTLE WORKS STUDIO
    http://www.LittleWorksStudio.com
     
    Jonathan N. Little, Dec 6, 2007
    #2
    1. Advertising

  3. Guest

    >
    > Add
    >
    > td img { display: block; }
    >
    > to your stylesheet should fix your problem... images are inline by
    > default...
    >

    Grate! It helps! Thanks a lot!
     
    , Dec 6, 2007
    #3
    1. Advertising

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. J.T. Conklin
    Replies:
    1
    Views:
    449
    David Hilsee
    Aug 11, 2004
  2. Andy
    Replies:
    5
    Views:
    518
    Shezan Baig
    Jan 30, 2005
  3. Replies:
    1
    Views:
    587
    Salt_Peter
    Dec 25, 2006
  4. donet programmer
    Replies:
    3
    Views:
    1,584
    Gregory A. Beamer
    Nov 20, 2009
  5. Girish
    Replies:
    0
    Views:
    113
    Girish
    Jan 22, 2004
Loading...

Share This Page