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://pics.10026.com/?src=http://www.ccnmatthews.com/images/red_dot.gif"
height="6" width="10" border="0">
</td>
</tr>
</table
<p> </p
<table cellspacing="0" cellpadding="0" border="1" >
<tr>
<td>
<img src="http://pics.10026.com/?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.
LeiTry 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" <marathoner@.sina.com> wrote in message
news:5929ac79.0404260623.763e22fd@.posting.google.c om...
> 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://pics.10026.com/?src=http://www.ccnmatthews.com/images/red_dot.gif"
> height="6" width="10" border="0">
> </td>
> </tr>
> </table>
> <p> </p>
> <table cellspacing="0" cellpadding="0" border="1" >
> <tr>
> <td>
> <img src="http://pics.10026.com/?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
Setting img to display:block works. Thanks a lot!
I could return the hard returns, but display:block is definitely much more elegant.
Lei
<johndoe@.driver.net> wrote in message news:<unUsbt5KEHA.268@.TK2MSFTNGP10.phx.gbl>...
> 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" <marathoner@.sina.com> wrote in message
> news:5929ac79.0404260623.763e22fd@.posting.google.c om...
> > 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://pics.10026.com/?src=http://www.ccnmatthews.com/images/red_dot.gif"
> > height="6" width="10" border="0">
> > </td>
> > </tr>
> > </table>
> > <p> </p>
> > <table cellspacing="0" cellpadding="0" border="1" >
> > <tr>
> > <td>
> > <img src="http://pics.10026.com/?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
0 comments:
Post a Comment