You are here: Re: W3C validation error « HTML « IT news, forums, messages
Re: W3C validation error

Posted by dorayme on 12/19/07 03:24

In article <gvsk35-hv3.ln1@ophelia.g5n.co.uk>,
Toby A Inkster <usenet200712@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

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация