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. Advertising

  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. Advertising

  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. 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. Replies:
    0
    Views:
    543
  2. Kevin Spencer

    Re: Simple Simple question!!!

    Kevin Spencer, Jun 25, 2004, in forum: ASP .Net
    Replies:
    0
    Views:
    645
    Kevin Spencer
    Jun 25, 2004
  3. Justin Rich
    Replies:
    2
    Views:
    394
    Justin Rich
    Jun 15, 2005
  4. Daniel Frey

    Simple Question - Simple Answer?

    Daniel Frey, Dec 28, 2004, in forum: XML
    Replies:
    4
    Views:
    822
    Daniel Frey
    Jan 12, 2005
  5. Wladimir Borsov
    Replies:
    4
    Views:
    279
    Tintin
    May 11, 2006
Loading...

Share This Page