Reply to Re: What if you don't have a thead/tbody/tfoot?

Your name:

Reply:


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]


Удаленная работа для программистов  •  Как заработать на 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

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