DEV Community

Cover image for HTML tags | thead
Carlos Espada
Carlos Espada

Posted on • Edited on

4

HTML tags | thead

It is used to define the set of rows that make up the header of a table.

It has no attributes other than global ones, so to define presentation aspects, CSS properties such as background-color, text-align or vertical-align will be used.

Must appear after <caption> and <colgroup> elements, but before any <tbody>, <tfoot>, or <tr> element.

Browsers can use <thead>, <tbody> and <tfoot> to allow scrolling of the body of the table independently of the header and footer. Similarly, when doing CSS for printing and if the table is spread across multiple pages, these elements can allow both the header and footer to appear repeated at the beginning and end of each printed page.

<thead>, <tbody>, and <tfoot> together also serve to provide useful semantic information used when rendering for screen or printer, as well as to improve accessibility.

Has an implicit ARIA role rowgroup.

  • Type: table-header-group
  • Self-closing: No
  • Semantic value: No

Definition and example | Support

Speedy emails, satisfied customers

Postmark Image

Are delayed transactional emails costing you user satisfaction? Postmark delivers your emails almost instantly, keeping your customers happy and connected.

Sign up

Top comments (0)

Sentry image

See why 4M developers consider Sentry, “not bad.”

Fixing code doesn’t have to be the worst part of your day. Learn how Sentry can help.

Learn more