473,385 Members | 1,279 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

Simple HTML question

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
Nov 18 '05 #1
2 1004
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" <ma********@sina.com> wrote in message
news:59**************************@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://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

Nov 18 '05 #2
Setting img to display:block works. Thanks a lot!

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

Lei

<jo*****@driver.net> wrote in message news:<un*************@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" <ma********@sina.com> wrote in message
news:59**************************@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://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

Nov 18 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

7
by: gene.ellis | last post by:
Good morning. I am racking my brains over what seems like should be a simple question. I have a string that contains text and html. Basically, I would like to grab the HTML tags from the string and...
16
by: Terry | last post by:
Hi, This is a newbie's question. I want to preload 4 images and only when all 4 images has been loaded into browser's cache, I want to start a slideshow() function. If images are not completed...
6
by: koen colen | last post by:
Hi, simple question I guess. The question is actually in the code itself as this was the simplest way to explain. .... var favorite = GetCookie('lang'); if (favorite != null) { switch...
3
by: trialanderror | last post by:
Both of these apply to using IE 6.0 or Netscape 7.x: First question: I am trying to set up a simple horizontal menu as a red strip across the browser window. Here is the relevant part of the...
13
by: LRW | last post by:
Having a problem getting a onSubmit function to work, to where it popsup a confirmation depending on which radiobutton is selected. Here's what I have: function checkdel() { if...
2
by: Ivan Demkovitch | last post by:
Hi! I'm trying to parse RSS news feed with code as simple as possible. Simple XML: <?xml version="1.0"?> <rss version="2.0"> <channel> <item>
2
by: Hazzard | last post by:
I just realized that the code I inherited is using all asp.net server controls (ie. webform controls) and when I try to update textboxes on the client side, I lose the new value of the textbox when...
0
by: 42 | last post by:
I implemented a simple class inherited from Page to create a page template. It simply wraps some trivial html around the inherited page, and puts the inherited page into a form. The problem I...
7
by: abcd | last post by:
I am trying to set up client machine and investigatging which .net components are missing to run aspx page. I have a simple aspx page which just has "hello world" printed.... When I request...
10
by: serge calderara | last post by:
Dear all, I need to build a web application which will contains articles (long or short) I was wondering on what is the correct way to retrive those article on web page. In orther words, when...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.