Code has been added to clipboard!

HTML thead Tag

Reading time 2 min
Published Jun 29, 2017
Updated Sep 11, 2019

HTML thead: Main Tips

  • In an HTML table, the thead tag is used to group header content.
  • HTML thead tag goes inside the <table> element and has <tr> elements nested inside.
  • The thead HTML element is used together with <tbody> and <tfoot> to define parts of a table.

Creating HTML Table Headers

The thead tag is used to define the top table row that contains the heads of the columns. In other words, it allows you to create HTML table headers:

Example
<table border>
 <thead>
  <tr>
    <td>Purchase</td>
    <td>Price</td>
  </tr>
 </thead>
</table>

You can only skip the ending tag if a <tbody> or <tfoot> follows your HTML thead element immediately.

Removed thead Tag Attributes

HTML thead tag used to have a few tag-specific attributes. However, all of them have been deprecated in HTML4 and removed completely in HTML5. You can use CSS properties to achieve similar results.

align defined the alignment of content for the <thead> element:

Example
<thead align="left">

Note: instead of align, use the CSS text-align property.

char set the alignment of content inside the <thead> according to the character specified:

Example
<thead align="char" char="M">

charoff set the number of characters for aligning the content after the character specified by the char attribute:

Example
<thead align="char" char="S" charoff="3">

valign set all the content inside the <thead> element to align vertically:

Example
<thead valign="bottom">

Note: instead of valign, use the CSS vertical-align property.

Browser Support

Chrome
1+
Edge
All
Firefox
1+
IE
All
Opera
All
Safari
All

Mobile Browser Support

Chrome
All
Firefox
4+
Opera
All
Safari
All
Basics
Introduction
Syntax
Editors
Basic Examples
Head Section
<!DOCTYPE>
Tags and Elements
Semantic Elements
Tags Reference
Attributes
Comments
Block and Inline Elements
Forms
Form Elements
Input
Responsive Web Design
Inline Scripts
Uniform Resource Locator
Redirect
XHTML
Geolocation
Drag and Drop
Local Storage
Web Workers
Server-Sent Events
Character Encoding
Text Formatting
Quotation and Citation Elements
Headings
Paragraphs
Links
Tables
Lists
Symbols
Space
Tab
Styles
Computer Code
Layout
Classes
Colors
Images
iframes
Audio Player
Video Player
YouTube Videos
Multimedia
Canvas
SVG
<!-- -->
<a>
<abbr>
<acronym> DEPRECATED
<address>
<applet> DEPRECATED
<article>
<aside>
<audio>
<b>
<base>
<basefont> DEPRECATED
<bdi>
<bdo>
<big> DEPRECATED
<blink> DEPRECATED
<blockquote>
<body>
<br>
<button>
<canvas>
<caption>
<center> DEPRECATED
<cite>
<code>
<col>
<colgroup>
<datalist>
<dd>
<del>
<details>
<dfn>
<dialog>
<dir> DEPRECATED
<div>
<dl>
<dt>
<em>
<embed>
<fieldset>
<figcaption>
<figure>
<font> DEPRECATED
<footer>
<form>
<frame> DEPRECATED
<frameset> DEPRECATED
<h1> – <h6>
<head>
<header>
<hr>
<html>
<i>
<iframe>
<img>
<input>
<ins>
<kbd>
<keygen> DEPRECATED
<label>
<legend>
<li>
<link>
<main>
<map>
<mark>
<menu>
<menuitem> DEPRECATED
<meta>
<meter>
<nav>
<noframes> DEPRECATED
<noscript>
<object>
<ol>
<optgroup>
<option>
<output>
<p>
<param>
<pre>
<progress>
<q>
<rp>
<rt>
<ruby>
<s>
<samp>
<script>
<section>
<select>
<small>
<source>
<span>
<strike> DEPRECATED
<strong>
<style>
<sub>
<summary>
<sup>
<table>
<tbody>
<td>
<tfoot>
<th>
<thead>
<time>
<title>
<tr>
<track>
<tt> DEPRECATED
<u>
<ul>
<var>
<video>
<wbr>