By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
449,350 Members | 1,209 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 449,350 IT Pros & Developers. It's quick & easy.

XHTML 1.1 strict validation of <THEAD> and <TFOOT>

P: n/a
I tried validating my gallery page using your validator.
http://validator.w3.org/check?uri=ht...ry%2Findex.asp

To my surprise it informed me that <tfoot> wasn't valid XHTML 1.1 strict,
while it is in the document definition:
http://www.w3.org/TR/xhtml-modulariz...#s_tablemodule

My <thead> tag apparently was valid, while my <tfoot> wasn't.

I would appreciate it if anyone could clarify the matter.

Greetings,
Maurice van Creij
Jul 20 '05 #1
Share this Question
Share on Google+
11 Replies


P: n/a
Woolly Mittens <wm******@hotmailz.com> wrote:
I tried validating my gallery page using your validator.
http://validator.w3.org/check?uri=ht...ry%2Findex.asp

To my surprise it informed me that <tfoot> wasn't valid XHTML 1.1 strict,
while it is in the document definition:
http://www.w3.org/TR/xhtml-modulariz...#s_tablemodule


The TFOOT element needs to come before the TBODY element. Tables should
contain, in the following order:

- an optional CAPTION, followed by
- optional COL and COLGROUP elements, followed by
- an optional THEAD element, followed by
- an optional TFOOT element, and then
- one or more TBODY elements

See also http://www.htmlhelp.com/reference/ht...les/table.html

(This hasn't changed since HTML 4.)
--
Darin McGrew, mc****@stanfordalumni.org, http://www.rahul.net/mcgrew/
Web Design Group, da***@htmlhelp.com, http://www.HTMLHelp.com/

"Pick battles big enough to matter, small enough to win." - Jonathan Kozel
Jul 20 '05 #2

P: n/a

"Darin McGrew" <mc****@stanfordalumni.org> wrote in message
news:bs**********@blue.rahul.net...
Woolly Mittens <wm******@hotmailz.com> wrote:
The TFOOT element needs to come before the TBODY element. Tables should
contain, in the following order:


Thanks, but isn't it odd to put the footer before the body?
Wouldn't that mess up the reading order in text-browsers?
Jul 20 '05 #3

P: n/a
Woolly Mittens wrote:
"Darin McGrew" <mc****@stanfordalumni.org> wrote in message
news:bs**********@blue.rahul.net...
The TFOOT element needs to come before the TBODY element. Tables should
contain, in the following order:


Thanks, but isn't it odd to put the footer before the body?
Wouldn't that mess up the reading order in text-browsers?


If the browser knows how to handle tables - no. The idea is that the
browser could display the header and the footer, right away, then
progressively fill in the body. Even to display the body in a
scrollable box which doesn't overflow the canvas and the header and
footer are visible without scrolling the document.

--
Stanimir
Jul 20 '05 #4

P: n/a
In article <3f*********************@news.wanadoo.nl> in
comp.infosystems.www.authoring.html, Woolly Mittens wrote:

"Darin McGrew" <mc****@stanfordalumni.org> wrote in message
news:bs**********@blue.rahul.net...
Woolly Mittens <wm******@hotmailz.com> wrote:
The TFOOT element needs to come before the TBODY element. Tables should
contain, in the following order:


Thanks, but isn't it odd to put the footer before the body?
Wouldn't that mess up the reading order in text-browsers?


Yes, and maybe.

My Netscape 4 displays the <tfoot> before the body, but MSIE 4
displays the foot after the body. Netscape 6 displays the <tfoot> at
the end of the table.
Here's the test HTML I used:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">
<html>
<head><title>TFOOT test</title></head>
<body>
<table border=2>
<thead><tr><th>col head 1</th><th>col head 2</th></tr></thead>
<tfoot><tr><td colspan=2>This table contains no useful content
whatever. The present note is inside a &lt;tfoot&gt;
tag.</td></tr></tfoot>
<tr><td>cell 11</td><td>cell 12</td></tr>
<tr><td>cell 21</td><td>cell 22</td></tr>
<tr><td>cell 31</td><td>cell 32</td></tr>
<tr><td>cell 41</td><td>cell 42</td></tr>
</table>
</body>
</html>
--
Stan Brown, Oak Road Systems, Cortland County, New York, USA
http://OakRoadSystems.com/
HTML 4.01 spec: http://www.w3.org/TR/html401/
validator: http://validator.w3.org/
CSS 2 spec: http://www.w3.org/TR/REC-CSS2/
2.1 changes: http://www.w3.org/TR/CSS21/changes.html
validator: http://jigsaw.w3.org/css-validator/
Jul 20 '05 #5

P: n/a
Stan Brown wrote:
Here's the test HTML I used:

[snip]


Make use of <tbody> for the last set of rows.
--
Anne van Kesteren
<http://www.annevankesteren.nl/>
Jul 20 '05 #6

P: n/a
In article <bt**********@reader11.wxs.nl> in
comp.infosystems.www.authoring.html, Anne van Kesteren wrote:
Stan Brown wrote:
Here's the test HTML I used:

[snip]


Make use of <tbody> for the last set of rows.


(1) Why? It's optional, so including or omitting it should make no
difference.

(2) As a matter of fact, I did try it both ways, just to see if
there were an obscure bug in NS4. It didn't matter.

--
Stan Brown, Oak Road Systems, Cortland County, New York, USA
http://OakRoadSystems.com/
HTML 4.01 spec: http://www.w3.org/TR/html401/
validator: http://validator.w3.org/
CSS 2 spec: http://www.w3.org/TR/REC-CSS2/
2.1 changes: http://www.w3.org/TR/CSS21/changes.html
validator: http://jigsaw.w3.org/css-validator/
Jul 20 '05 #7

P: n/a
Stan Brown wrote:
In article <bt**********@reader11.wxs.nl> in
comp.infosystems.www.authoring.html, Anne van Kesteren wrote:
Stan Brown wrote:
Here's the test HTML I used:

[snip]


Make use of <tbody> for the last set of rows.

(1) Why? It's optional, so including or omitting it should make no
difference.

(2) As a matter of fact, I did try it both ways, just to see if
there were an obscure bug in NS4. It didn't matter.


Why use <thead> (or am I making a stupid mistake here?)?

--
Anne van Kesteren
<http://www.annevankesteren.nl/>
Jul 20 '05 #8

P: n/a
In article <bt**********@reader11.wxs.nl>, one of infinite monkeys
at the keyboard of Anne van Kesteren <ma**@annevankesteren.nl> wrote:
Why use <thead> (or am I making a stupid mistake here?)?


To mark up a table header?

Even if you don't care about semantics, it's a great hook for CSS
if (like me) you find many tables benefit from a clear visual
distinction between the headers and data.

--
Nick Kew

In urgent need of paying work - see http://www.webthing.com/~nick/cv.html
Jul 20 '05 #9

P: n/a
>> In article <bt**********@reader11.wxs.nl> in
comp.infosystems.www.authoring.html, Anne van Kesteren wrote:
Make use of <tbody> for the last set of rows.
Stan Brown wrote:
(1) Why? It's optional, so including or omitting it should make no
difference.

(2) As a matter of fact, I did try it both ways, just to see if
there were an obscure bug in NS4. It didn't matter.

In article <bt**********@reader11.wxs.nl> in
comp.infosystems.www.authoring.html, Anne van Kesteren wrote:Why use <thead> (or am I making a stupid mistake here?)?


Because modern browsers, when printing a long table, will repeat the
column headings at the top of each page if they're inside <thead>.
(Mozilla 1.4 qualifies as a modern browser on this score. I don't
know whether there are any others.)

Once again, why did you suggest putting in <tbody>?

--
Stan Brown, Oak Road Systems, Cortland County, New York, USA
http://OakRoadSystems.com/
HTML 4.01 spec: http://www.w3.org/TR/html401/
validator: http://validator.w3.org/
CSS 2 spec: http://www.w3.org/TR/REC-CSS2/
2.1 changes: http://www.w3.org/TR/CSS21/changes.html
validator: http://jigsaw.w3.org/css-validator/
Jul 20 '05 #10

P: n/a
Stan Brown wrote:
Why use <thead> (or am I making a stupid mistake here?)?
Because modern browsers, when printing a long table, will repeat the
column headings at the top of each page if they're inside <thead>.
(Mozilla 1.4 qualifies as a modern browser on this score. I don't
know whether there are any others.)


Sorry about that, you are totally right. I haven't worked much with
tables yet.
Once again, why did you suggest putting in <tbody>?
<http://www.w3.org/TR/html401/struct/tables.html#h-11.2.3>
The TBODY start tag is always required except when the table contains
only one table body and no table head or foot sections. The TBODY end
tag may always be safely omitted.

--
Anne van Kesteren
<http://www.annevankesteren.nl/>
Jul 20 '05 #11

P: n/a
In article <bt**********@reader10.wxs.nl> in
comp.infosystems.www.authoring.html, Anne van Kesteren wrote:
<http://www.w3.org/TR/html401/struct/tables.html#h-11.2.3>
The TBODY start tag is always required except when the table contains
only one table body and no table head or foot sections. The TBODY end
tag may always be safely omitted.


Thank you!

I was going by the syntax description near the start of that
section, which simply reads:
<!ELEMENT TBODY O O (TR)+ -- table body -->
Start tag: optional, End tag: optional
But you are quite correct about the later text.

Now I'm going to have to go through all my tables that have <thead>
and put in <tbody>. :-( But it's better to know than not to know.

--
Stan Brown, Oak Road Systems, Cortland County, New York, USA
http://OakRoadSystems.com/
HTML 4.01 spec: http://www.w3.org/TR/html401/
validator: http://validator.w3.org/
CSS 2 spec: http://www.w3.org/TR/REC-CSS2/
2.1 changes: http://www.w3.org/TR/CSS21/changes.html
validator: http://jigsaw.w3.org/css-validator/
Jul 20 '05 #12

This discussion thread is closed

Replies have been disabled for this discussion.