Latest web development tutorials

HTML <tbody> tag

Examples

HTML form with <thead>, <tfoot> and <tbody> element:

<table border="1">
<thead>
<tr>
<th>Month</th>
<th>Savings</th>
</tr>
</thead>
<tfoot>
<tr>
<td>Sum</td>
<td>$180</td>
</tr>
</tfoot>
<tbody>
<tr>
<td>January</td>
<td>$100</td>
</tr>
<tr>
<td>February</td>
<td>$80</td>
</tr>
</tbody>
</table>

try it"

Browser Support

Internet ExplorerFirefoxOperaGoogle ChromeSafari

All major browsers support the <tbody> tag.


Tag definitions and instructions

<Tbody> tag is used to form a combination of HTML body content.

<tbody> element should be <thead> and <tfoot> various parts of the elements used in combination for the prescribed form (subject, header, footer).

By using these elements, so that the browser has the ability to support independent of the table header and the table footer table body roll. When included several pages long tables are printed, the table headers and footers can be printed on each page that contains table data.

<Tbody> tag must be used in the following situations: as a child element <table> element appears after the <caption>, <colgroup> and <thead> element.


Tips and Notes

NOTE: <tbody> internal element must contain one or more <tr> tag.

Tip: <thead>, <tbody> and <tfoot> element does not affect the default table layout.However, you can use CSS to define styles for these elements, so as to change the appearance of tables.


Differences between HTML 4.01 and HTML5

In the HTML 5, HTML 4.01 any property <tbody> tag is no longer supported.


Attributes

属性 描述
align right
left
center
justify
char
HTML5 不支持。定义 <tbody> 元素中内容的对齐方式。
char character HTML5 不支持。规定 <tbody> 元素中内容根据哪个字符来对进行文本对齐。
charoff number HTML5 不支持。规定 <tbody> 元素中内容的第一个对齐字符的偏移量。
valign top
middle
bottom
baseline
HTML5 不支持。规定 <tbody> 元素中内容的垂直对齐方式。


Global Properties

<tbody> tag supports HTML global properties .


Event Properties

<tbody> tag supports HTML event properties .