VOOZH about

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

⇱ Bootstrap 5 Table Captions - GeeksforGeeks


  • Courses
  • Tutorials
  • Interview Prep

Bootstrap 5 Table Captions

Last Updated : 23 Jul, 2025

Bootstrap 5 Table Captions are used to set the caption position on the table. A table caption is required to put the table name or single keyword information. If you want to use the caption in a different font with proper visibility then you can use any tag for the table caption, caption tag is for that purpose only but you can use any other tag.

Note: A normal caption tag has to put the caption below the table.

Bootstrap 5 Table Captions Class:

  • caption-top: This class is used to set the caption position on the top left corner.

Syntax:

<table class="table caption-top">
 <caption>....</caption>
 ...
</table>

The below example illustrates the Bootstrap 5 Table Captions:

Example 1: In this example, we will create 2 tables one will contain the caption tag element with the caption class on the table tag and another will contain an h3 tag with a caption class on the table tag.

Output:

👁 Image
 

Example 2: In this example, we will create a 4*4 table where the table caption is dedicated.

Output:

👁 Bootstrap 5 Table Captions
Bootstrap 5 Table Captions

Reference: https://getbootstrap.com/docs/5.0/content/tables/#captions

Comment
Article Tags:

Explore