NOTE: The current preferred location for bug reports is the GitHub issue tracker.
Bug 993 - Validator rejects h3 as a child of th
Validator rejects h3 as a child of th
Status: RESOLVED INTENTIONAL
Product: Validator.nu
Classification: Unclassified
Component: Browser-based UI
HEAD
All All
: P2 normal
Assigned To: Nobody
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2014-03-25 18:16 CET by kjpetrie
Modified: 2014-03-26 10:15 CET (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description kjpetrie 2014-03-25 18:16:57 CET
Overview: According to the W3C page http://www.w3.org/TR/html-markup/th.html#th flow content, which includes the h1-h6 tags, is permitted within a th element in HTML5. However, the validator reports an h3 tag inside a th as an error.

Steps to reproduce: Enter the following URL into a web browser:
http://validator.nu/?doc=http%3A%2F%2Fwww.k2bristol.org.uk%2F%3Ftopnode%3DEvents

Actual results: The validator reports "Error: The element h3 must not appear as a descendant of the th element.
From line nn, column 1; to line nn, column 4
v0">↩<th>↩<h3>Caf&ea" for each row in the table on the page under test.

Expected result: The validator should not have reported these as errors.
Comment 1 Michael[tm] Smith 2014-03-26 10:15:58 CET
(In reply to kjpetrie from comment #0)
> Overview: According to the W3C page
> http://www.w3.org/TR/html-markup/th.html#th flow content,

That document is not up to date. Please don't use it. (Actually, please don't ever use documents in the http://www.w3.org/TR/ tree—they are pretty much all always out of date.)

For up-to-date document-conformance rules for HTML, please instead always use:

  http://www.whatwg.org/specs/web-apps/current-work/multipage/

> which includes the
> h1-h6 tags, is permitted within a th element in HTML5. However, the
> validator reports an h3 tag inside a th as an error.

Please see http://www.whatwg.org/specs/web-apps/current-work/multipage/tabular-data.html#the-th-element

That says the content model for <th> is

— Flow content, but with no header, footer, sectioning content, or heading content descendants, and if the th element is a sorting interface th element, no interactive content descendants.

<h3> is heading content, so it's not allowed in <th>

So the validator conforms to the spec for this case.