Connecting Tech Pros Worldwide Forums | Help | Site Map

how is whitespace interpreted?

Matthew Monopole
Guest
 
Posts: n/a
#1: Jul 20 '05
in making a tablelayout, I noticed that
<td><img /></td>
is different, when displayed to
<td>
<img />
</td>

in face, my tablelayout would look really bad in the second form...can
anyone tell me what's HTML's standard for parsing those white space?



Mark Parnell
Guest
 
Posts: n/a
#2: Jul 20 '05

re: how is whitespace interpreted?


Matthew Monopole wrote:[color=blue]
> in making a tablelayout, I noticed that
> <td><img /></td>
> is different, when displayed to
> <td>
> <img />
> </td>
>
> in face, my tablelayout[/color]

Tables are for tabular data.

http://www.allmyfaqs.com/faq.pl?Tableless_layouts
[color=blue]
> would look really bad in the second form...can
> anyone tell me what's HTML's standard for parsing those white space?[/color]

White space, whether it be one character space, one line, 300 lines, etc is
always displayed as a 1 character space. IOW,

<td>
<img />
</td>

is the same as

<td> <img /> </td>

is the same as

<td>





<img />





</td>

etc.

HTH

--

Mark Parnell
http://www.clarkecomputers.com.au


Jacqui or (maybe) Pete
Guest
 
Posts: n/a
#3: Jul 20 '05

re: how is whitespace interpreted?


In article <XeuMa.21480$C83.2034754@newsread1.prod.itd.earthl ink.net>,
mathfield@hotmail.com says...[color=blue]
> in making a tablelayout, I noticed that
> <td><img /></td>
> is different, when displayed to
> <td>
> <img />
> </td>
>
> in face, my tablelayout would look really bad in the second form...can
> anyone tell me what's HTML's standard for parsing those white space?
>[/color]
http://www.w3.org/TR/html401/appendi...s.html#h-B.3.1 states that the
newline after <td> should be ignored. However, a lot of browsers get it
wrong as you've discovered.

Also note that:

<td>
stuff
</td>

Has spaces in addition to the newline and these should be displayed as a
singe space.
Closed Thread