RE: Question about tables

> From: Becker, Klaus (LNG-MUE)

> What is the correct use of the elements THEAD, TBODY  and TFOOT?

Klaus,

I can't really quote from any authoritive documents, but my understanding
(possibly wrong?) has always been that having, if you're using any of the
elements above, TBODY is certainly essential (as that's where your data
goes...without it, you wouldn't have a data table, and without that you
shouldn't be using THEAD,TBODY or TFOOT anyway, as they're only useful
for proper data tables, as opposed to layout ones); in turn, if you do
have data in TBODY, then you need to define headers for it, and these
need to be wrapped in THEAD if you're already using TBODY. Now, TFOOT may
not always be needed, as you may not always require footers.
A table containing only THEAD or TFOOT does not make sense...what would it
achieve? THEAD alone would just define headers for...what? Same with TFOOT
on its own.

If your question was more along the lines of if it's allowed to have something
like

<table>
  <thead>
    <tr><th>some heading</th></tr>
  <thead>
  <tr><td>data</td></tr>
</table>

(i.e. only using one of these elements, but keeping the rest of the table -
with data and all - as normal) then I'd say that it doesn't really make sense:
in the example above, if you're already wrapping the head in THEAD to explicitly
define which part of the table represents the repeating headers, why not
just add TBODY as well to explicitly mark the boundaries of the actual table
data?

Sorry, long rambling reply, full of sound and fury, but light on authoritive
references...

MfG
Patrick
________________________________
Patrick H. Lauke
Webmaster / University of Salford
http://www.salford.ac.uk

Received on Tuesday, 30 November 2004 13:38:30 UTC