![]() |
VOOZH | about |
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:
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:
Example 2: In this example, we will create a 4*4 table where the table caption is dedicated.
Output:
Reference: https://getbootstrap.com/docs/5.0/content/tables/#captions