What exactly is the point of the <tbody> tag? Can one table consist of more than one pair of these tags?

Recommended Answers

All 11 Replies

I think:
<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>

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?
Thanks,
BuddyB

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.
BB

no problem ;)

hi,,,,,
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>
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.