|
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!
|