Simple HTML question

Discussion in 'ASP .Net' started by Lei Wu, Apr 26, 2004.

  1. Lei Wu

    Lei Wu Guest

    Hi, guys,

    As an Internet developer for many years, I thought I knew HTML...
    until I came across this:

    The following two tables look different in IE 6.0. I've pinpointed the
    cause -- the hard return between the <img> tag and the </td> tag. I
    thought hard returns don't make a differnt unless in <pre> tags, but
    apparently I was wrong.

    <table cellpadding="0" cellspacing="0" border="1">
    <tr>
    <td>
    <img src="http://www.ccnmatthews.com/images/red_dot.gif"
    height="6" width="10" border="0">
    </td>
    </tr>
    </table>

    <p>&nbsp;</p>

    <table cellspacing="0" cellpadding="0" border="1" >
    <tr>
    <td>
    <img src="http://www.ccnmatthews.com/images/red_dot.gif" height="6"
    width="10" border="0"></td>
    </tr>
    </table>

    My problem is, because my HTML is generated from Xsl.XslTransform,
    there are hard returns after the image tag within the table cell. But
    I want it to look like the second table.

    Can somebody help me out? Thank you.

    By the way, Netscape 7.01 gives the same result. However, in Opera
    7.23 the two tables look the same, which is my desired result.

    Lei
     
    Lei Wu, Apr 26, 2004
    #1
    1. Advertisements

  2. Lei Wu

    Guest Guest

    Try removing the hard return. You might also set the image to display:block;
    to try getting rid of anyother whitespace that doesnt. Certain whitepsace is
    "supposed" to be there because images are inline-block by default iirc. Its
    explained on the w3c in some abnormal inhumane way


    "Lei Wu" <> wrote in message
    news:...
    > Hi, guys,
    >
    > As an Internet developer for many years, I thought I knew HTML...
    > until I came across this:
    >
    > The following two tables look different in IE 6.0. I've pinpointed the
    > cause -- the hard return between the <img> tag and the </td> tag. I
    > thought hard returns don't make a differnt unless in <pre> tags, but
    > apparently I was wrong.
    >
    > <table cellpadding="0" cellspacing="0" border="1">
    > <tr>
    > <td>
    > <img src="http://www.ccnmatthews.com/images/red_dot.gif"
    > height="6" width="10" border="0">
    > </td>
    > </tr>
    > </table>
    >
    > <p>&nbsp;</p>
    >
    > <table cellspacing="0" cellpadding="0" border="1" >
    > <tr>
    > <td>
    > <img src="http://www.ccnmatthews.com/images/red_dot.gif" height="6"
    > width="10" border="0"></td>
    > </tr>
    > </table>
    >
    > My problem is, because my HTML is generated from Xsl.XslTransform,
    > there are hard returns after the image tag within the table cell. But
    > I want it to look like the second table.
    >
    > Can somebody help me out? Thank you.
    >
    > By the way, Netscape 7.01 gives the same result. However, in Opera
    > 7.23 the two tables look the same, which is my desired result.
    >
    > Lei
     
    Guest, Apr 26, 2004
    #2
    1. Advertisements

  3. Lei Wu

    Lei Wu Guest

    Setting img to display:block works. Thanks a lot!

    I could return the hard returns, but display:block is definitely much more elegant.

    Lei

    <> wrote in message news:<>...
    > Try removing the hard return. You might also set the image to display:block;
    > to try getting rid of anyother whitespace that doesnt. Certain whitepsace is
    > "supposed" to be there because images are inline-block by default iirc. Its
    > explained on the w3c in some abnormal inhumane way
    >
    >
    > "Lei Wu" <> wrote in message
    > news:...
    > > Hi, guys,
    > >
    > > As an Internet developer for many years, I thought I knew HTML...
    > > until I came across this:
    > >
    > > The following two tables look different in IE 6.0. I've pinpointed the
    > > cause -- the hard return between the <img> tag and the </td> tag. I
    > > thought hard returns don't make a differnt unless in <pre> tags, but
    > > apparently I was wrong.
    > >
    > > <table cellpadding="0" cellspacing="0" border="1">
    > > <tr>
    > > <td>
    > > <img src="http://www.ccnmatthews.com/images/red_dot.gif"
    > > height="6" width="10" border="0">
    > > </td>
    > > </tr>
    > > </table>
    > >
    > > <p>&nbsp;</p>
    > >
    > > <table cellspacing="0" cellpadding="0" border="1" >
    > > <tr>
    > > <td>
    > > <img src="http://www.ccnmatthews.com/images/red_dot.gif" height="6"
    > > width="10" border="0"></td>
    > > </tr>
    > > </table>
    > >
    > > My problem is, because my HTML is generated from Xsl.XslTransform,
    > > there are hard returns after the image tag within the table cell. But
    > > I want it to look like the second table.
    > >
    > > Can somebody help me out? Thank you.
    > >
    > > By the way, Netscape 7.01 gives the same result. However, in Opera
    > > 7.23 the two tables look the same, which is my desired result.
    > >
    > > Lei
     
    Lei Wu, Apr 26, 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. Justin Rich
    Replies:
    2
    Views:
    492
    Justin Rich
    Jun 15, 2005
  2. Daniel Frey

    Simple Question - Simple Answer?

    Daniel Frey, Dec 28, 2004, in forum: XML
    Replies:
    4
    Views:
    1,118
    Daniel Frey
    Jan 12, 2005
  3. Oli

    simple simple question

    Oli, Jan 26, 2004, in forum: ASP General
    Replies:
    10
    Views:
    617
    Roland Hall
    Jan 26, 2004
  4. Peter Bailey

    simple, simple array question

    Peter Bailey, Apr 8, 2008, in forum: Ruby
    Replies:
    7
    Views:
    480
    Peter Bailey
    Apr 8, 2008
  5. Adam Akhtar
    Replies:
    9
    Views:
    860
    Florian Gilcher
    Aug 16, 2008
  6. Kirk

    Simple Question = simple answer?

    Kirk, Sep 23, 2003, in forum: Javascript
    Replies:
    1
    Views:
    277
    Martin Honnen
    Sep 23, 2003
  7. Wladimir Borsov
    Replies:
    4
    Views:
    504
    Tintin
    May 11, 2006
  8. db
    Replies:
    7
    Views:
    439
Loading...