Posts in current category

HTML5 <thead> tag


May 03, 2021 20:00 HTML5


Table of contents


HTML5 is used to combine headers in a table. Please refer to the following example:

HTML tables with elements of the elements of the .

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

Browser support

HTML5 <thead> tag HTML5 <thead> tag HTML5 <thead> tag HTML5 <thead> tag HTML5 <thead> tag

All major browsers support the hashtag.


Label definition and instructions for use

The label is used to combine the header content of an HTML table.

The elements should be used in combination with the elements of the table (header, body, footer).

By using these elements, the browser has the ability to support table body scrolling independent of the table header and table footer. When a long table with multiple pages is printed, the table header and footer of the table can be printed on each page that contains the table data.

The label must be used in the following situations: as a child element of the element, appears before the element, after the element, and after the element, and after the element, the element, the lt;tbody,tfoot, and the element.


Tips and comments

Note: The inside of the element must contain one or more labels.

Tip: The default of the elements does not affect the layout of the table. However, you can use CSS to define styles for these elements to change the appearance of the table.


The difference between HTML 4.01 and HTML5

In HTML 5, no longer supports any properties of the label in HTML 4.01.


Property

Property Value Describe
align right
left
center
justify
char
HTML5 is not supported. Defines the alignment of the content in the element.
char character HTML5 is not supported. Specifies which character the content in the element is text-aligned to.
charoff number HTML5 is not supported. Specifies the offset of the first aligned character of the content in the element.
valign top
middle
bottom
baseline
HTML5 is not supported. Specifies the vertical alignment of the content in the element.


Global properties

The label supports the global properties of HTML.


The event property

The tag supports the event properties of HTML.