Click here to get back home

W3C markup validator and missing table tags

 HomeNewsGroups | Search | About
 comp.infosystems.www.authoring.html    Post an article   get this group's latest topics as an RSS feed add this group's latest topics to your My MSN content add this group's latest topics to your My Yahoo content
Subject Author Date
W3C markup validator and missing table tags Jamie 12-06-2005
Get Chitika Premium
Posted by Jamie on December 6, 2005, 4:20 pm
Please log in for more thread options


Maybe I am mis-understanding the function of the
W3C Markup validation Service at validator.w3.org,
but shouldn't it pick up errors like below?

You can cut & paste this straight into the validator:

--------------------------------------------------------------------------------------
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<HTML>
<HEAD>
<TITLE>blah</TITLE>
<BODY>

<TABLE>
<TR>
<TD>test
</TABLE>
</BODY>
</HTML>
--------------------------------------------------------------------------------------

As you can see, the closing </TD> and </TR> tags are omitted from
the table.


Posted by Andy Dingley on December 7, 2005, 12:44 am
Please log in for more thread options



>Maybe I am mis-understanding the function of the
>W3C Markup validation Service at validator.w3.org,
>but shouldn't it pick up errors like below?

Those aren't errors.

HTML is an SGML-like format. You have supplied a doctype and so the
application (validator, browser or whatever) can use the implied DTD in
order to parse the document and judge its validity.

For your fragment:
><TABLE>
> <TR>
> <TD>test
></TABLE>

The <td> element is implicitly closed by the </table> tag, because
that's the only place it's permissible to close it. There's no need to
_explicitly_ include the </td> and so SGML's or HTML's rules don't
require it to be there.

This is in contrast to XML. XML must always be explicitly closed. This
also means that XML can be fully parsed without knowing the DTD in
advance.

Posted by Lars Eighner on December 7, 2005, 7:07 am
Please log in for more thread options


In our last episode,
the lovely and talented Jamie
broadcast on comp.infosystems.www.authoring.html:

> Maybe I am mis-understanding the function of the
> W3C Markup validation Service at validator.w3.org,
> but shouldn't it pick up errors like below?

> You can cut & paste this straight into the validator:

>
--------------------------------------------------------------------------------------
><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
><HTML>
><HEAD>
><TITLE>blah</TITLE>
><BODY>

><TABLE>
> <TR>
> <TD>test
></TABLE>
></BODY>
></HTML>
>
--------------------------------------------------------------------------------------

> As you can see, the closing </TD> and </TR> tags are omitted from
> the table.

That's right. And it isn't an error. You need to learn to read
DTDs. You declared the 4.01 loose DTD. In 4.01, the end tags
for TD and TR are optional.

Read the DTD
<!--
This is the HTML 4.01 Transitional DTD, which includes
presentation attributes and elements that W3C expects to phase out
as support for style sheets matures. Authors should use the Strict
DTD when possible, but may use the Transitional DTD when support
for presentation attribute and elements is required.

. . .

<!ELEMENT TR - O (TH|TD)+ -- table row -->
<!ELEMENT (TH|TD) - O (%flow;)* -- table header cell, table data cell-->

As you can see, the end tags are optional.

--
Lars Eighner usenet@larseighner.com http://www.larseighner.com/
Save the Rainforest! Eat a vegetarian!

Similar ThreadsPosted
Markup Validator April 5, 2007, 11:32 am
[ANN] Beta test of the W3C Markup Validator (0.7.0 beta 1) July 12, 2005, 10:27 pm
Problem with Validator: Form spanning accross table rows does notvalidate August 4, 2004, 5:48 pm
Style tags -- Eeek how obese these tags make HTML! November 8, 2006, 3:33 am
Border missing in Firefox but not IE6 December 22, 2004, 12:26 pm
CSS border missing in FireFox, ok in IE January 6, 2008, 10:50 pm
Missing entitites - Invalid or not well-formed ? October 15, 2004, 3:15 am
Fundamental problem with HTML, or am I missing something? January 24, 2005, 8:29 pm
Missing valid-html401 icon March 11, 2005, 7:27 pm
Meta Tags, Link Tags, other September 27, 2005, 3:29 pm

Our other projects:

Art Dolls, Fairies and Mermaids - Sunnyfaces.net

Roy's Linux, Programming and Search Engines messages

1-Script XML SitemapXML Sitemap