Re: W3C validation error

In article <gvsk35-hv3.ln1 [at] ophelia.g5n.co.uk>,
Toby A Inkster <usenet200712 [at] tobyinkster.co.uk> wrote:

> dorayme wrote:
>
> > On the other hand, I notice that you have a </tbody> but no <tbody> in
> > your last table. This you may not want to have?
>
> Even with the strict DTD, that's perfectly valid.

Hence my weasel words "This you may not want to have?". With JK's
eagle eye, I cannot afford the least carelessness. <g>

> The TBODY element is
> implicitly opened as soon as a TR element is encountered that is not
> enclosed in a THEAD or TFOOT element. The content models of the various
> table-related elements given in the strict DTD are:
>
> <!ELEMENT TABLE - -
> (CAPTION?, (COL*|COLGROUP*), THEAD?, TFOOT?, TBODY+)>
> <!ELEMENT CAPTION - - (%inline;)* -- table caption -->
> <!ELEMENT THEAD - O (TR)+ -- table header -->
> <!ELEMENT TFOOT - O (TR)+ -- table footer -->
> <!ELEMENT TBODY O O (TR)+ -- table body -->
> <!ELEMENT COLGROUP - O (COL)* -- table column group -->
> <!ELEMENT COL - O EMPTY -- table column -->
> <!ELEMENT TR - O (TH|TD)+ -- table row -->
> <!ELEMENT (TH|TD) - O (%flow;)* -- table header cell, table data
> cell-->
>
> You'll notice that TABLE *must* contain a TBODY and cannot contain a
> TR. Thus any TRs that are not part of the THEAD or TFOOT automatically
> begin the TBODY element, which has an optional opening tag. So the
> following is a valid TABLE element:
>
> <TABLE>
> <TR>
> <TD>Hello
> </TBODY>
> </TABLE>
>
> Such tables may be undesirable though, so it may be a good idea to create
> a custom DTD that tightens up the rules for opening and closing tags for
> table-related elements.

About:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<title>Lineupnumberedheadings</title>
</head>
<body>
<TABLE>
<TR>
<TD>Hello
</TBODY>
</TABLE>
</body>
</html>

My BBEdit says:

Error: Close element “</tbody>” found but element wasn't open.
Warning: Element “<tr>” implicitly closed here.
Warning: Element “<td>” implicitly closed here.

I am happy about the warnings (these can be controlled to some
extent from Preferences/HTML Tools. But the *error* slightly
disturbs me after reading your above?

--
dorayme
dorayme [ Mi, 19 Dezember 2007 04:24 ] [ ID #1890964 ]

Re: W3C validation error

In article
<doraymeRidThis-4FA5AE.14245319122007 [at] news-vip.optusnet.com.au>,
dorayme <doraymeRidThis [at] optusnet.com.au> wrote:

> My BBEdit says:
>
> Error: Close element “</tbody>” found but element wasn't open.
> Warning: Element “<tr>” implicitly closed here.
> Warning: Element “<td>” implicitly closed here.

Actually it said:

Error: Close element </tbody> found but element wasn't open.
Warning: Element <tr> implicitly closed here.
Warning: Element <td> implicitly closed here.

--
dorayme
dorayme [ Mi, 19 Dezember 2007 04:45 ] [ ID #1890966 ]
Miscellaneous » alt.html » Re: W3C validation error

Vorheriges Thema: List of free web site design, web site backgrounds, web site layouts
Nächstes Thema: Re: easily scalable images