|
Posted by Michael Fesser on 01/08/08 17:48
..oO(TonyV)
>If I include a thead and tbody without a tfoot,
>the page doesn't validate.
I can't reproduce that. Can you post an example URL? I think there must
be another error in your markup. The following simple code snippet does
validate as HTML 4.01 Strict, XHTML 1.0 Strict and XHTML 1.1:
<table>
<thead>
<tr><th>test</th></tr>
</thead>
<tbody>
<tr><td>content</td></tr>
</tbody>
</table>
>Also, if I include a tfoot without a tr,
>or a tfoot with a tr without a td, the page doesn't validate.
This is correct.
>On Jan 6, 12:24 pm, Michael Fesser <neti...@gmx.de> wrote:
>> >I've read that in XHTML 1.1, if you have a thead and tbody, you *must*
>> >have a tfoot.
>>
>> Where have you read that?
>
>At the W3Schools site. It seems to be a very reliable reference that
>I use all the time. Here's the specific link to the page:
>http://www.w3schools.com/tags/tag_tbody.asp
>
>In the tips and notes section, it says, "If you use the thead, tfoot
>and tbody elements, you must use every element." I'm guessing that
>they've parsed the DTD and this is how it's interpreted. The page not
>validating seems to back it up.
This statement is wrong or at least misleading. Given the DTD and the
actual validation results, I would say it this way:
By default all rows are put into an implicit 'tbody', so there's no need
to declare it. But if you use any of the row group elements 'tbody',
'thead' or 'tfoot', then every row must be contained in an explicitly
declared row group.
Micha
[Back to original message]
|