RE: how to use thead and tbody

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

> I am using Tables in my page and as far as I know I have written
> correct HTML Code, still InFocus says "thead and tbody not used
> properly". Anybody has an exmaple page or code using thead and
> tbody?

In general:

<table>
  <thead>
    <tr>
    ..various "header" cells, often these will be <th>
    </tr>
    ...more rows if necessary.
  </thead>
  <tbody>
    <tr>
    ...various "body" cells, generally these will be <td>
    </tr>
    ...more rows if necessary.
  </tbody>
  <tfoot>
    <tr>
    ...various "footer" cells, generally these will be <td>
    </tr>
    ...more rows if necessary.
  </tfoot>
</table>

Where any of those three can be absent and there can be more than one
tbody.

When thead, tbody and tfoot were introduced (I think with HTML3.2) it
was decided that <tbody> should be assumed, so:

<table><tr><td>data</td></tr></table>
should be considered the same as:
<table><tbody><tr><td>data</td></tr></tbody></table>

In other words your table has a tbody element even though there is no
tbody tag.

With XHTML1.0 there had to be a choice with elements for which the
tag could be left out to either enforce their presence (as was done
with <html>, <head> and <body> which strictly speaking could be left
out before), or to allow them in the DTD. (leaving out <tbody> is now
allowed by that spec).
However it is still considered better to include the element at all
times.

-----BEGIN PGP SIGNATURE-----
Version: PGPfreeware 6.5.3 for non-commercial use <http://www.pgp.com>

iQA/AwUBO59734Fpv9f1Mr0YEQK67gCgqz/ozdIr/s50CORfEtkO05QJ2zkAn1Zr
lNO9Gk/dWZ2vSKrMaaDKT6SY
=Ihyh
-----END PGP SIGNATURE-----

Received on Wednesday, 12 September 2001 11:12:05 UTC