HTML thead tag and element

HTML thead element

1. HTML thead (table header) element defines the block of rows that consist of the column headers for an HTML table.

2. A table header starts with <thead> tag and ends with </thead> tag.




HTML thead element is a part of HTML Tables.

Whether both start and end tags are required

The start tag is required but end tag is optional.

Can contain

HTML thead element can contain inline elements.

Can reside within

HTML thead element can reside within a table element.


Attributes specific to this element

align : Specifies the position of the caption with respect to the table.

Value Description
top Places the caption at the top of the table. Default.
right Places the caption at the right of the table.
bottom Places the caption at the bottom of the table.
left Places the caption to the left of the table.


id, class.

language information and text direction

lang, dir.






onclick, ondblclick, onmousedown, onmouseup, onmouseover, onmousemove, onmouseout, onkeypress, onkeydown, onkeyup.

Cell alignment

align, char and charoff attributes.

Supported doctypes

HTML 4.01 Strict, HTML 4.01 Transitional, and HTML 4.01 Frameset.

Example of using HTML thead element

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>html thead tag example</title>
<table border="1">
<th>Student code </th>
<th>% of marks </th>


html thead element

View this example in a separate browser window

HTML thead tag example.

Pictorial presentation


Previous: HTML caption tag and element
Next: HTML tfoot tag and element

Test your Programming skills with w3resource's quiz.

Follow us on Facebook and Twitter for latest update.

We are closing our Disqus commenting system for some maintenanace issues. You may write to us at reach[at]yahoo[dot]com or visit us at Facebook