What exactly is the point of the <tbody> tag? Can one table consist of more than one pair of these tags?
<thead> is all the column headings, i.e. the first row of most tables
<tbody> is the data under those headings
so technically if you need two tbodies then you must have changed column headings, which technically is another table.
Or wasn't that what you had in mind?
My question is whether it is legal to do:
<table> <thead> <tr><td>Heading</td></tr> </thead> <tbody> <tr><td>Body 1</td></tr> </tbody> <tbody> <tr><td>Body 2</td></tr> </tbody> </table>
it validates in xhtml 1.0 strict.
It refers to needing 'one or more' tbody elements in a table.
So I guess you can.
edit: see also http://www.w3.org/TR/html4/struct/tables.html#h-11.2.3 - which also refers to one or more
Oh cool! Thanks. Definitely answers my question.
lol no problem ;)
Has this replaced <TD></TD>? If not when do you use one over the other?
tbody is for grouping td tags.
The TBODY element defines a group of data rows in a table.
so in a data table, your column headings would be in a thead tag, the main body of the td cells in a tbody, and the footer info in a tfoot tag. Or something like that anyway.
I got it, thanks.
no problem ;)
cn u plz suggest me sumthing 4 ma web project??
My web project topic is Cartoons..
so wat exactly i should do??
plzz rly,,if u hv any idea regarding wid dis..
This is not quite right.
The purpose of tbody is to go with thead and tfoot to make a table that has a header and footer that are always visible when the table is larger than a page.
If you use tbody, you also need to use thead and tfoot, and they must be placed in the following order:
<table> <thead> <tr> <th>stuff 1</th><th>stuff 2</th> </tr> </thead> <tfoot> <tr> <th>stuff 1</th><th>stuff 2</th> </tr> </tfoot> <tbody> <tr> <td>stuff 1</td><td>stuff 2</td> </tr> </tbody> </table>