HTML <thead> tag
Example
An HTML table with a thead, tbody, and a tfoot element:
<table border="1">
<thead>
<tr>
<th>Month</th>
<th>Savings</th>
</tr>
</thead>
<tbody>
<tr>
<td>January</td>
<td>$100</td>
</tr>
<tr>
<td>February</td>
<td>$80</td>
</tr>
</tbody>
<tfoot>
<tr>
<td>Sum</td>
<td>$180</td>
</tr>
</tfoot>
</table> |
Try it yourself!
|
Definition and Usage
The <thead> tag is used to group the header content in an HTML table.
The thead element should be used in conjunction with the
tbody and tfoot
elements.
The tbody element is used to group the body content in an HTML table and
the tfoot element is used to group the footer content in an HTML table.
Notice that these elements will not affect the layout of the table by default. However,
you can use CSS to let these elements affect the table's layout.
Browser Support
The <thead> tag is only partially supported in all major browsers.
Differences Between HTML and XHTML
NONE
Optional Attributes
DTD indicates in which DTD the attribute is
allowed. S=Strict, T=Transitional, and F=Frameset.
Attribute |
Value |
Description |
DTD |
align |
right
left
center
justify
char |
Aligns the
content inside the thead element |
STF |
char |
character |
Aligns the content inside the thead element to a character |
STF |
charoff |
pixels
% |
Sets the number of characters the content inside the thead
element will be aligned
from the character specified by the char attribute |
STF |
valign |
top
middle
bottom
baseline |
Vertical aligns the
content inside the thead element |
STF |
Standard Attributes
id, class, title, style, dir, lang, xml:lang |
For a full description, go to Standard
Attributes.
Event Attributes
onclick, ondblclick, onmousedown, onmouseup, onmouseover, onmousemove, onmouseout, onkeypress, onkeydown, onkeyup
|
For a full description, go to Event Attributes.
The Altova MissionKit is a suite of intelligent XML tools, including:
XMLSpy® – industry-leading XML editor
- Support for all XML-based technologies
- Graphical editing views, powerful debuggers, code generation, & more
MapForce® – graphical data mapping tool
- Drag-and-drop data conversion with code generation
- Support for XML, DBs, EDI, Excel® 2007, text, Web services
StyleVision® – visual stylesheet designer
- Drag-and-drop stylesheet design for XML & databases
- Output to HTML, PDF, RTF, Word 2007, & more
And more…
Try before you buy with a free fully functional 30-day trial
Download today
|
|
Get Your Diploma!
W3Schools' Online Certification Program is the perfect solution for busy
professionals who need to balance work, family, and career building.
The HTML Certificate is for developers who want to document their knowledge of HTML, XHTML, and CSS.
The JavaScript Certificate is for developers who want to document their knowledge of JavaScript and the HTML DOM.
The XML Certificate is for developers who want to document their knowledge of XML, XML DOM and XSLT.
The ASP Certificate is for developers who want to document their knowledge of ASP, SQL, and ADO.
The PHP Certificate is for developers who want to document their knowledge of PHP and SQL (MySQL).
|
|