VOOZH about

URL: https://www.geeksforgeeks.org/bootstrap/bootstrap-5-table-head/

⇱ Bootstrap 5 Table head - GeeksforGeeks


  • Courses
  • Tutorials
  • Interview Prep

Bootstrap 5 Table head

Last Updated : 23 Jul, 2025

Bootstrap 5 Table head class is used to set the thead elements' background color. Sometimes we need a table with a dark header for a better-suited situation. We can use these classes to change the background color of the thead section of a table.

Bootstrap 5 Table head Classes:

  • table-light: This class is used to set the background color of the element light gray.
  • table-dark: This class is used to set the background color of the element dark gray.

Syntax: The * is replaceable with light and dark.

<table class="table">
 <thead class="table-*">
 ...
 </thead>
 <tbody>
 ...
 </tbody>
</table>

Example 1: In this example, we will create a light header table.

Output:

👁 Bootstrap 5 Table head
Bootstrap 5 Table head

Example 2: In this example, we will create a dark header table.

Output:

👁 Bootstrap 5 Table head
Bootstrap 5 Table head

Reference: https://getbootstrap.com/docs/5.0/content/tables/#table-head

Comment
Article Tags:

Explore