YouTip LogoYouTip

Tag Thead

HTML <thead> Tag body { font-family: sans-serif; margin: 20px; } pre { background-color: #f4f4f4; padding: 15px; overflow-x: auto; border-radius: 5px; } .table-example { border-collapse: collapse; width: 50%; margin-bottom: 20px; } .table-example th, .table-example td { border: 1px solid #ccc; padding: 8px; text-align: left; } .attr-table { width: 100%; border-collapse: collapse; margin-bottom: 20px; } .attr-table th, .attr-table td { border: 1px solid #ddd; padding: 8px; text-align: left; } .nav-list { list-style-type: none; padding: 0; display: flex; flex-wrap: wrap; gap: 10px; } .nav-list li { white-space: nowrap; } .menu-title { font-weight: bold; border-bottom: 1px solid #eee; padding-bottom: 5px; margin-bottom: 10px; } .section-title { margin-top: 30px; color: #333; border-left: 5px solid #009900; padding-left: 10px; } .ad-banner { background: #fafafa; border: 1px solid #ddd; padding: 10px; margin: 20px 0; } .footer { margin-top: 50px; border-top: 1px solid #ccc; padding-top: 10px; font-size: 12px; color: #666; } a { color: #009900; text-decoration: none; } a:hover { text-decoration: underline; }
-- Learn not only technology, but also dreams!
Home HTML JAVASCRIPT CSS VUE REACT PYTHON3 JAVA C C++ C# AI GO SQL LINUX VS CODE BOOTSTRAP GIT Local Bookmarks

HTML Reference Manual


HTML Tags

HTML <th> Tag HTML <time> Tag Deep Dive

HTML <thead> Tag

Example

HTML table with <thead>, <tfoot>, and <tbody> elements:

<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 yourself »

Browser Support

All major browsers support the <thead> tag.

Tag Definition and Usage Instructions

The <thead> tag is used to group header content in an HTML table.

The <thead> element should be used together with <tbody> and <tfoot> elements to specify different parts of the table (header, body, footer).

By using these elements, browsers can support independent scrolling of the table body apart from the table header and footer. When a long table spanning multiple pages is printed, the table header and footer can be printed on every page containing the table data.

The <thead> tag must be used in the following scenarios: as a child element of the <table> element, appearing after <caption> and <colgroup> elements, and before <tbody>, <tfoot>, and <tr> elements.

Tips and Notes

Note: The <thead> element must contain one or more <tr> tags internally.

Tip: The <thead>, <tbody>, and <tfoot> elements do not affect the table layout by default. However, you can use CSS to style these elements to change the appearance of the table.

Differences between HTML 4.01 and HTML5

In HTML 5, any attributes for the <thead> tag supported in HTML 4.01 are no longer supported.

Attributes

Attribute Value Description
align right, left, center, justify HTML5 does not support. Defines the alignment of content within the <thead> element.
char character HTML5 does not support. Specifies which character the text in the <thead> element aligns according to.
charoff number HTML5 does not support. Specifies the offset of the first aligned character for content in the <thead> element.
valign top, middle, bottom, baseline HTML5 does not support. Specifies the vertical alignment of content within the <thead> element.

Global Attributes

The <thead> tag supports global HTML attributes.

Event Attributes

The <thead> tag supports event attributes of HTML.

HTML <th> Tag HTML <time> Tag

Byte Ark Coding Plan

Supports mainstream large models such as Doubao, GLM, DeepSeek, Kimi, MiniMax, official supply stable and reliable.

¥9.9 / month Activate Now

iFlytek Xingchen Coding Plan

Includes free model invocation quota, DeepSeek, GLM, Kimi, MiniMax, one-stop experience and deployment platform.

¥3.9 / month Activate Now

Click here to share notes
Category Navigation

Python / Data Science | AI / Intelligent Development | Front-end Development | Back-end Development | Database | Mobile Development | DevOps / Engineering | Programming Languages | Computer Basics | XML / Web Service | .NET | Website Construction

Advertisement

HTML Tag List (Alphabetical Order)
HTML Tag List (Functional Order)
HTML Global Attributes
HTML Events
HTML Canvas
HTML Audio/Video
Valid HTML DOCTYPES
HTML Color Names
HTML Color Picker
HTML Color Mixing
HTML Emoji
HTML Character Set
HTML ASCII
HTML ISO-8859-1
HTML Symbols
HTML URL Encoding
HTML Language Codes
HTML Country/Region Codes
HTTP Messages
HTTP Methods
Px/Em Conversion Tool
Keyboard Shortcuts

HTML Tags

Online Example

  • · HTML Example
  • · CSS Example
  • · JavaScript Example
  • · Ajax Example
  • · jQuery Example
  • · XML Example
  • · Java Example

Character Set & Tools

  • · HTML Character Set Settings
  • · HTML ASCII Character Set
  • · JS Obfuscation/Encryption
  • · PNG/JPEG Image Compression
  • · HTML Color Picker
  • · JSON Formatter
  • · Random Number Generator

Latest Updates

  • · Dart Enumerations and Symbols
  • · Dart Unit Testing
  • · Dart Concurrency and Iso...
  • · Dart Stream Flows
  • · Dart Async Programming
  • · Dart typedef and...
  • · Dart Package and Library Management

Site Info

  • · Feedback
  • · Disclaimer
  • · About Us
  • · Archives

Follow WeChat

My Favorites, Mark Article, Browse History, Clear All, No Records Yet
← Tag TimeTag Th →