Welcome to WebHeadStart.org

Web Technologies

Sponsored By

WebHeadStart.org is currently in beta.
Please pardon our appearance as we work to provide you with the most comprehensive reference on today's web technologies.

Interested in advertising on WebHeadStart? Become an advertising partner today!

[WWW-HTML Mailing List Archive Home] [Messages By Thread] [Messages By Date]

Re: HTML 4.01 DTD

From: Satoshi ISHIKAWA <webmaster@satoshii.org>
Date: Fri, 16 Apr 2004 18:33:10 +0900
To: <www-html@w3.org>
Message-ID: <BCA5D766.2697%webmaster@satoshii.org>

Robert van Loenhout <r.vanloenhout@greenvalley.nl> wrote:
> <!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-->
> 
> This definition seems to me that a TR tag is not allowed to be a direct
> child of
> a TABLE tag. This surprised me... Also because when I validate a 4.01
> document
> with the w3c validator it says it is valid.
> 
> Could someone explain this?

As you quoted, the TABLE element MUST contain one or more TBODY elements,
and both of start tag and end tag of TBODY are omissible.

That is, in HTML 4.01

  <TABLE>
    <TR>...</TR>
    <TR>...</TR>
  </TABLE>

is equal to 

  <TABLE>
    <TBODY>
      <TR>...</TR>
      <TR>...</TR>
    </TBODY>
  </TABLE>.

So it is valid, to be sure.

# In addition, in the case of XHTML table, the table element is allowed
# to contain the tr elements directly.

Regards,
-- 
Satoshi ISHIKAWA / webmaster@satoshii.org
http://www.satoshii.org/markup/ 
Received on Friday, 16 April 2004 05:33:18 GMT
Valid XHTML 1.0! Valid CSS! Site Map | Privacy Policy | Terms of Use | WebHeadStart.org © 2005 All Rights Reserved.