In Bootstrap 5.3, tables can be easily styled and made responsive using the built-in classes and components provided by Bootstrap. Here's an explanation of tables in Bootstrap 5.3:
In Bootstrap 5.3, a normal table refers to a basic table structure that can be easily styled and customized using Bootstrap's classes. Here's an explanation of how to create a normal table in Bootstrap 5.3:
<table class="table"> <thead> <tr> <th>Heading</th> <th>Heading</th> <th>Heading</th> <th>Heading</th> <th>Heading</th> </tr> </thead> <tbody> <tr> <td>Data</td> <td>Data</td> <td>Data</td> <td>Data</td> <td>Data</td> </tr> <tr> <td>Data</td> <td>Data</td> <td>Data</td> <td>Data</td> <td>Data</td> </tr> <tr> <td>Data</td> <td>Data</td> <td>Data</td> <td>Data</td> <td>Data</td> </tr> <tr> <td>Data</td> <td>Data</td> <td>Data</td> <td>Data</td> <td>Data</td> </tr> <tr> <td>Data</td> <td>Data</td> <td>Data</td> <td>Data</td> <td>Data</td> </tr> </tbody> </table>
In Bootstrap 5.3, you can easily apply different colors to tables using the available utility classes. Here's an explanation of the table color options in Bootstrap 5.3
Background Color Classes: Bootstrap also provides utility classes for applying specific background colors to table rows or cells. These classes are applied to the <tr> or <td> elements. The available background color classes are:
These classes allow you to apply specific colors to table rows or cells to match your design or highlight specific information.
<table class="table table-dark"> <thead> <tr> <th>Heading</th> <th>Heading</th> <th>Heading</th> <th>Heading</th> <th>Heading</th> </tr> </thead> <tbody> <tr> <td>Data</td> <td>Data</td> <td>Data</td> <td>Data</td> <td>Data</td> </tr> <tr> <td>Data</td> <td>Data</td> <td>Data</td> <td>Data</td> <td>Data</td> </tr> <tr class="table-dark"> <td>Data</td> <td>Data</td> <td>Data</td> <td>Data</td> <td>Data</td> </tr> <tr class="table-secondary"> <td>Data</td> <td>Data</td> <td>Data</td> <td>Data</td> <td>Data</td> </tr> <tr> <td>Data</td> <td class="table-secondary">Data</td> <td>Data</td> <td>Data</td> <td>Data</td> </tr> </tbody> </table>
By using these classes, you can easily add color variations to your tables in Bootstrap 5.3. Apply the desired class to the appropriate elements within your table, such as <tr> or <td>, to achieve the desired color effect.
In Bootstrap 5.3, you can easily apply different colors to tables using the available utility classes. Here's an explanation of the table color options in Bootstrap 5.3
By following these steps, you can create a striped table in Bootstrap 5.3. The striped pattern improves readability and helps users visually separate and differentiate rows in a table. Remember to include the necessary Bootstrap CSS and JavaScript files in your project to ensure that the Bootstrap styles and functionalities are properly applied to the table and other elements.
<table class="table table-striped"> <thead> <tr> <th>Heading</th> <th>Heading</th> <th>Heading</th> <th>Heading</th> <th>Heading</th> </tr> </thead> <tbody> <tr> <td>Data</td> <td>Data</td> <td>Data</td> <td>Data</td> <td>Data</td> </tr> <tr> <td>Data</td> <td>Data</td> <td>Data</td> <td>Data</td> <td>Data</td> </tr> <tr> <td>Data</td> <td>Data</td> <td>Data</td> <td>Data</td> <td>Data</td> </tr> <tr> <td>Data</td> <td>Data</td> <td>Data</td> <td>Data</td> <td>Data</td> </tr> <tr> <td>Data</td> <td>Data</td> <td>Data</td> <td>Data</td> <td>Data</td> </tr> </tbody> </table>
In Bootstrap 5.3, you can create striped tables by using the "table-striped-columns" class. A striped table alternates the background color of table columns, making it easier to read and distinguish between columns. Here's an explanation of how to create a striped table in Bootstrap 5.3
<table class="table table-striped-columns table-dark"> <thead> <tr> <th>Heading</th> <th>Heading</th> <th>Heading</th> <th>Heading</th> <th>Heading</th> </tr> </thead> <tbody> <tr> <td>Data</td> <td>Data</td> <td>Data</td> <td>Data</td> <td>Data</td> </tr> <tr> <td>Data</td> <td>Data</td> <td>Data</td> <td>Data</td> <td>Data</td> </tr> <tr> <td>Data</td> <td>Data</td> <td>Data</td> <td>Data</td> <td>Data</td> </tr> <tr> <td>Data</td> <td>Data</td> <td>Data</td> <td>Data</td> <td>Data</td> </tr> <tr> <td>Data</td> <td>Data</td> <td>Data</td> <td>Data</td> <td>Data</td> </tr> </tbody> </table>
In Bootstrap 5.3, you can create a hover effect on table rows using the "table-hover" class. This class adds interactivity to your table by highlighting rows when hovering over them. Here's an explanation of how to create a hover table in Bootstrap 5.3
Add the "table-hover" class: To create a hover effect on table rows, apply the "table-hover" class to the <table> element. For example, your table declaration would look like this: <table class="table table-hover">
<table class="table table-hover"> <thead> <tr> <th>Heading</th> <th>Heading</th> <th>Heading</th> <th>Heading</th> <th>Heading</th> </tr> </thead> <tbody> <tr> <td>Data</td> <td>Data</td> <td>Data</td> <td>Data</td> <td>Data</td> </tr> <tr> <td>Data</td> <td>Data</td> <td>Data</td> <td>Data</td> <td>Data</td> </tr> <tr> <td>Data</td> <td>Data</td> <td>Data</td> <td>Data</td> <td>Data</td> </tr> <tr> <td>Data</td> <td>Data</td> <td>Data</td> <td>Data</td> <td>Data</td> </tr> <tr> <td>Data</td> <td>Data</td> <td>Data</td> <td>Data</td> <td>Data</td> </tr> </tbody> </table>
Highlight a table row or cell by adding a .table-active class.
<table class="table"> <thead> <tr> <th>Heading</th> <th>Heading</th> <th>Heading</th> <th>Heading</th> <th class="table-active">Heading</th> </tr> </thead> <tbody> <tr> <td>Data</td> <td>Data</td> <td>Data</td> <td>Data</td> <td>Data</td> </tr> <tr class="table-active"> <td>Data</td> <td>Data</td> <td>Data</td> <td>Data</td> <td>Data</td> </tr> <tr> <td>Data</td> <td>Data</td> <td>Data</td> <td>Data</td> <td>Data</td> </tr> <tr> <td class="table-active">Data</td> <td>Data</td> <td>Data</td> <td>Data</td> <td>Data</td> </tr> <tr> <td>Data</td> <td>Data</td> <td>Data</td> <td>Data</td> <td>Data</td> </tr> </tbody> </table>
In Bootstrap 5.3, the "table-bordered" class allows you to add borders to the cells of a table, creating a bordered appearance. Here's an explanation of how to use the "table-bordered" class in Bootstrap 5.3
Add the "table-bordered" class: To create a table with borders around its cells, apply the "table-bordered" class to the <table> element. For example, your table declaration would look like this: <table class="table table-bordered">
<table class="table table-bordered"> <thead> <tr> <th>Heading</th> <th>Heading</th> <th>Heading</th> <th>Heading</th> <th>Heading</th> </tr> </thead> <tbody> <tr> <td>Data</td> <td>Data</td> <td>Data</td> <td>Data</td> <td>Data</td> </tr> <tr> <td>Data</td> <td>Data</td> <td>Data</td> <td>Data</td> <td>Data</td> </tr> <tr> <td>Data</td> <td>Data</td> <td>Data</td> <td>Data</td> <td>Data</td> </tr> <tr> <td>Data</td> <td>Data</td> <td>Data</td> <td>Data</td> <td>Data</td> </tr> <tr> <td>Data</td> <td>Data</td> <td>Data</td> <td>Data</td> <td>Data</td> </tr> </tbody> </table>
Add .table-bordered for borders on all sides of the table and cells.
<table class="table table-bordered border-light table-dark"> <thead> <tr> <th>Heading</th> <th>Heading</th> <th>Heading</th> <th>Heading</th> <th>Heading</th> </tr> </thead> <tbody> <tr> <td>Data</td> <td>Data</td> <td>Data</td> <td>Data</td> <td>Data</td> </tr> <tr> <td>Data</td> <td>Data</td> <td>Data</td> <td>Data</td> <td>Data</td> </tr> <tr> <td>Data</td> <td>Data</td> <td>Data</td> <td>Data</td> <td>Data</td> </tr> <tr> <td>Data</td> <td>Data</td> <td>Data</td> <td>Data</td> <td>Data</td> </tr> <tr> <td>Data</td> <td>Data</td> <td>Data</td> <td>Data</td> <td>Data</td> </tr> </tbody> </table>
In Bootstrap 5.3, you can create a borderless table by using the "table-borderless" class. This class allows you to remove the borders around the cells of a table, resulting in a clean and borderless appearance. Here's an explanation of how to create a borderless table in Bootstrap 5.3.
Add the "table-borderless" class: To create a table without borders around its cells, apply the "table-borderless" class to the <table> element. For example, your table declaration would look like this: <table class="table table-borderless">
<table class="table table-borderless"> <thead> <tr> <th>Heading</th> <th>Heading</th> <th>Heading</th> <th>Heading</th> <th>Heading</th> </tr> </thead> <tbody> <tr> <td>Data</td> <td>Data</td> <td>Data</td> <td>Data</td> <td>Data</td> </tr> <tr> <td>Data</td> <td>Data</td> <td>Data</td> <td>Data</td> <td>Data</td> </tr> <tr> <td>Data</td> <td>Data</td> <td>Data</td> <td>Data</td> <td>Data</td> </tr> <tr> <td>Data</td> <td>Data</td> <td>Data</td> <td>Data</td> <td>Data</td> </tr> <tr> <td>Data</td> <td>Data</td> <td>Data</td> <td>Data</td> <td>Data</td> </tr> </tbody> </table>
In Bootstrap 5.3, you can create a compact table by using the "table-sm" class. This class reduces the padding and font size of the table, making it more compact and suitable for displaying larger amounts of data in a limited space. Here's an explanation of how to create a compact table in Bootstrap 5.3
Add the "table-sm" class: To create a compact table, apply the "table-sm" class to the <table> element. For example, your table declaration would look like this: <table class="table table-sm">
<table class="table table-sm"> <thead> <tr> <th>Heading</th> <th>Heading</th> <th>Heading</th> <th>Heading</th> <th>Heading</th> </tr> </thead> <tbody> <tr> <td>Data</td> <td>Data</td> <td>Data</td> <td>Data</td> <td>Data</td> </tr> <tr> <td>Data</td> <td>Data</td> <td>Data</td> <td>Data</td> <td>Data</td> </tr> <tr> <td>Data</td> <td>Data</td> <td>Data</td> <td>Data</td> <td>Data</td> </tr> <tr> <td>Data</td> <td>Data</td> <td>Data</td> <td>Data</td> <td>Data</td> </tr> <tr> <td>Data</td> <td>Data</td> <td>Data</td> <td>Data</td> <td>Data</td> </tr> </tbody> </table>
Add a thicker border, darker between table groups - <thead>, <tbody>, and <tfoot> - with .table-group-divider. Customize the color by changing the border-top-color.
<table class="table"> <thead> <tr> <th>Heading</th> <th>Heading</th> <th>Heading</th> <th>Heading</th> <th>Heading</th> </tr> </thead> <tbody class="table-group-divider" style="border-top-color: red"> <tr> <td>Data</td> <td>Data</td> <td>Data</td> <td>Data</td> <td>Data</td> </tr> <tr> <td>Data</td> <td>Data</td> <td>Data</td> <td>Data</td> <td>Data</td> </tr> <tr> <td>Data</td> <td>Data</td> <td>Data</td> <td>Data</td> <td>Data</td> </tr> <tr> <td>Data</td> <td>Data</td> <td>Data</td> <td>Data</td> <td>Data</td> </tr> <tr> <td>Data</td> <td>Data</td> <td>Data</td> <td>Data</td> <td>Data</td> </tr> </tbody> </table>
In Bootstrap 5.3, you can create nested tables by placing one table inside another. This technique allows you to organize and structure your data in a hierarchical manner. Here's an explanation of how to create nested tables in Bootstrap 5.3
<table class="table table-bordered"> <thead> <tr> <th>Heading</th> <th>Heading</th> </tr> </thead> <tbody> <tr> <td>Data</td> <td>Data</td> </tr> <tr> <td>Data</td> <td> <table class="table"> <thead> <tr> <th>Heading</th> <th>Heading</th> </tr> </thead> <tbody> <tr> <td>Data</td> <td>Data</td> </tr> <tr> <td>Data</td> <td>Data</td> </tr> </tbody> </table> </td> </tr> </tbody> </table>
In Bootstrap 5.3, you can create a table with a footer section to display additional information or summary data. The footer section appears below the table body and can be used to provide context or aggregate data. Here's an explanation of how to create a table with a footer in Bootstrap 5.3
Add the footer section: Use the <tfoot> element to define the footer section of the table. Inside the <tfoot> element, create a table row (<tr>) and populate it with the desired footer data. You can include the same number of cells as in the table body, or customize it to suit your specific requirements.
<table class="table"> <thead> <tr> <th>Heading</th> <th>Heading</th> <th>Heading</th> <th>Heading</th> <th>Heading</th> </tr> </thead> <tbody> <tr> <td>Data</td> <td>Data</td> <td>Data</td> <td>Data</td> <td>Data</td> </tr> <tr> <td>Data</td> <td>Data</td> <td>Data</td> <td>Data</td> <td>Data</td> </tr> <tr> <td>Data</td> <td>Data</td> <td>Data</td> <td>Data</td> <td>Data</td> </tr> <tr> <td>Data</td> <td>Data</td> <td>Data</td> <td>Data</td> <td>Data</td> </tr> <tr> <td>Data</td> <td>Data</td> <td>Data</td> <td>Data</td> <td>Data</td> </tr> </tbody> <tfoot class="table-primary"> <tr> <td>Footer Data</td> <td>Footer Data</td> <td>Footer Data</td> <td>Footer Data</td> <td>Footer Data</td> </tr> </tfoot> </table>
A <caption> functions like a heading for a table. It helps users with screen readers to find a table and understand what it's about and decide if they want to read it.
You can also put the <caption> on the top of the table with .caption-top.
<table class="table"> <caption class="caption-top"> Table Caption </caption> <thead> <tr> <th>Heading</th> <th>Heading</th> <th>Heading</th> <th>Heading</th> <th>Heading</th> </tr> </thead> <tbody> <tr> <td>Data</td> <td>Data</td> <td>Data</td> <td>Data</td> <td>Data</td> </tr> <tr> <td>Data</td> <td>Data</td> <td>Data</td> <td>Data</td> <td>Data</td> </tr> <tr> <td>Data</td> <td>Data</td> <td>Data</td> <td>Data</td> <td>Data</td> </tr> <tr> <td>Data</td> <td>Data</td> <td>Data</td> <td>Data</td> <td>Data</td> </tr> <tr> <td>Data</td> <td>Data</td> <td>Data</td> <td>Data</td> <td>Data</td> </tr> </tbody> </table>
In Bootstrap 5.3, you can create responsive tables that adapt to different screen sizes using the "table-responsive" class. This class ensures that the table remains horizontally scrollable on smaller screens, preventing it from overflowing the container and maintaining readability. Here's an explanation of how to create a responsive table in Bootstrap 5.3.
<div class="table-responsive"> <table class="table"> <thead> <tr> <th>Heading</th> <th>Heading</th> <th>Heading</th> <th>Heading</th> <th>Heading</th> <th>Heading</th> <th>Heading</th> <th>Heading</th> <th>Heading</th> <th>Heading</th> <th>Heading</th> <th>Heading</th> <th>Heading</th> <th>Heading</th> <th>Heading</th> <th>Heading</th> <th>Heading</th> <th>Heading</th> <th>Heading</th> <th>Heading</th> </tr> </thead> <tbody> <tr> <td>Data</td> <td>Data</td> <td>Data</td> <td>Data</td> <td>Data</td> <td>Data</td> <td>Data</td> <td>Data</td> <td>Data</td> <td>Data</td> <td>Data</td> <td>Data</td> <td>Data</td> <td>Data</td> <td>Data</td> <td>Data</td> <td>Data</td> <td>Data</td> <td>Data</td> <td>Data</td> </tr> <tr> <td>Data</td> <td>Data</td> <td>Data</td> <td>Data</td> <td>Data</td> <td>Data</td> <td>Data</td> <td>Data</td> <td>Data</td> <td>Data</td> <td>Data</td> <td>Data</td> <td>Data</td> <td>Data</td> <td>Data</td> <td>Data</td> <td>Data</td> <td>Data</td> <td>Data</td> <td>Data</td> </tr> <tr> <td>Data</td> <td>Data</td> <td>Data</td> <td>Data</td> <td>Data</td> <td>Data</td> <td>Data</td> <td>Data</td> <td>Data</td> <td>Data</td> <td>Data</td> <td>Data</td> <td>Data</td> <td>Data</td> <td>Data</td> <td>Data</td> <td>Data</td> <td>Data</td> <td>Data</td> <td>Data</td> </tr> <tr> <td>Data</td> <td>Data</td> <td>Data</td> <td>Data</td> <td>Data</td> <td>Data</td> <td>Data</td> <td>Data</td> <td>Data</td> <td>Data</td> <td>Data</td> <td>Data</td> <td>Data</td> <td>Data</td> <td>Data</td> <td>Data</td> <td>Data</td> <td>Data</td> <td>Data</td> <td>Data</td> </tr> <tr> <td>Data</td> <td>Data</td> <td>Data</td> <td>Data</td> <td>Data</td> <td>Data</td> <td>Data</td> <td>Data</td> <td>Data</td> <td>Data</td> <td>Data</td> <td>Data</td> <td>Data</td> <td>Data</td> <td>Data</td> <td>Data</td> <td>Data</td> <td>Data</td> <td>Data</td> <td>Data</td> </tr> <tr> <td>Data</td> <td>Data</td> <td>Data</td> <td>Data</td> <td>Data</td> <td>Data</td> <td>Data</td> <td>Data</td> <td>Data</td> <td>Data</td> <td>Data</td> <td>Data</td> <td>Data</td> <td>Data</td> <td>Data</td> <td>Data</td> <td>Data</td> <td>Data</td> <td>Data</td> <td>Data</td> </tr> <tr> <td>Data</td> <td>Data</td> <td>Data</td> <td>Data</td> <td>Data</td> <td>Data</td> <td>Data</td> <td>Data</td> <td>Data</td> <td>Data</td> <td>Data</td> <td>Data</td> <td>Data</td> <td>Data</td> <td>Data</td> <td>Data</td> <td>Data</td> <td>Data</td> <td>Data</td> <td>Data</td> </tr> <tr> <td>Data</td> <td>Data</td> <td>Data</td> <td>Data</td> <td>Data</td> <td>Data</td> <td>Data</td> <td>Data</td> <td>Data</td> <td>Data</td> <td>Data</td> <td>Data</td> <td>Data</td> <td>Data</td> <td>Data</td> <td>Data</td> <td>Data</td> <td>Data</td> <td>Data</td> <td>Data</td> </tr> </tbody> </table> </div>Live Preview
Learn All in Tamil © Designed & Developed By Tutor Joes | Privacy Policy | Terms & Conditions