HTML reference: tbody element details

Source: Internet
Author: User

Valid tags contained in the tbody element include:

TD
Th
Tr

The tbody element is automatically defined for all tables, even if the table does not explicitly define the tbody element.

Table objects and their related elements have independent table object models, which are quite different from the methods used in conventional object models.

This element is in Microsoft? HTML of Internet Explorer 3.0 is available, and scripts of Internet Explorer 4.0 are available.

This element is not rendered.

The label must be disabled for this element.

Tbody defines the table subject
    In a table, thead, tfoot, and tbody allow you to aggregate multiple rows in the table. When creating a table, you may want to have a title row, some rows for storing data, and the bottom row for storing the total. In the browser, you can use the scroll wheel to directly browse from start to end, when printing, the header and footer are re-added to the table (ensure that each printed page has a header and footer)

Standard attributes:ID, class, title, style, Dir, Lang, XML: Lang

Event attributes:Onclick, ondblclick, onmousedown, onmouseup, onmouseover, onmousemove, onmouseout, onkeypress, onkeydown, onkeyup

Instance:
<Table border = "1">
<Thead>
<Tr>
<TD> This text is in the thead </TD>
</Tr>
</Thead>
<Tfoot>
<Tr>
<TD> This text is in the tfoot </TD>
</Tr>
</Tfoot>
<Tbody>
<Tr>
<TD> This text is in the tbody </TD>
</Tr>
</Tbody>
</Table>

Each table can have a header, a table tail, and one or more table bodies, which are represented by thead, tfoot, and tbody elements respectively.

The tbody label can be used to control the download of table branches. When the table content is large, it is useful to add <tbody> and </tbody> at the branch download location, for example:

<Table>
<Tbody>
<Tr> <TD> windy days </TD> </tr>
<Tr> <TD> windy days </TD> </tr>
</Tbody>
<Tbody>
<Tr> <TD> windy days </TD> </tr>
<Tr> <TD> windy days </TD> </tr>
</Tbody>
</Table>
·<Tbody> is used in <Table>, for example:
<Table>
<Tbody>
   <Tr>
      <TD> </TD>
   </Tr>
</Tbody>
</Table>
The purpose of using tbody is to include theseCodeYou do not need to parse the entire table and display it together. That is to say, if there are multiple rows, you can display one row first if you get a tbody row.
The body is an HTML text body. an HTML file has only one body, and multiple tbodies can exist in the table.

·By default, you do not need to write <tbody>
However, to use innerhtml to change the table content, you must specify the tbody

<Table>
<Tbody id = "otbody">
</Tbody>
</Table>

Otbody. innerhtml = "<tr> <TD> Haha </TD> </tr> ";

·When you use thead, tfoot, and tbody elements, you must use each of them. The order of their appearance should also be as follows: <thead>, <tfoot> and <tbody>. Only in this way can the browser obtain the script information before receiving all data. You must also use them in the table element.

·<Thead>, <tbody>, and <tfoot> are not commonly used because their browser support is poor. However, it is expected to be improved in XHTML. If you have an IE browser or a later version, you can look at an example in our XML tutorial.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.