What is the thead element in HTML?

The <thead> element in HTML is used to wrap the header content of an HTML table to specify the header part of the table. <thead> is used alongside the <tbody> and <tfoot> elements to structure the HTML table content into its header, body, and footer parts.

Usage

  • The <thead> element must be a child of the <table> element.
  • <thead> must contain at least one <tr> element.
  • <thead> must come before any <tbody>,<tr>, and <tfoot> elements.
  • <thead> does not affect the layout of the table.
  • <thead> can be styled using CSS.

Example

Explanation

In the above HTML code, we display an HTML table that is structured into header, body, and footer content. The header content, which is the row containing “Subject” and “Marks,” is wrapped inside the <thead> element.

New on Educative
Learn to Code
Learn any Language as a beginner
Develop a human edge in an AI powered world and learn to code with AI from our beginner friendly catalog
🏆 Leaderboard
Daily Coding Challenge
Solve a new coding challenge every day and climb the leaderboard

Free Resources

Copyright ©2025 Educative, Inc. All rights reserved