Summarize this article with:

Tables remain one of the trickiest elements to style consistently across browsers. Raw HTML tables look dated and break on mobile screens.

Bootstrap tables examples solve both problems with pre-built CSS classes that handle striped rows, hover effects, responsive scrolling, and contextual colors out of the box.

This guide covers every table variant in the framework. You’ll find working code snippets for striped, bordered, hover, dark, and borderless styles.

We also cover responsive wrappers, vertical alignment options, nested table structures, and the most common implementation mistakes developers make.

Copy these examples directly into your frontend projects.

What is Bootstrap Table

Bootstrap table is a pre-styled HTML table element that uses the CSS framework’s utility classes for consistent formatting across web projects.

The .table class transforms standard tabular data into clean, readable layouts without writing custom stylesheets.

Bootstrap tables work for displaying datasets, pricing comparisons, schedules, and any structured information that benefits from row and column organization.

The framework handles cell padding, border styling, and responsive behavior automatically.

Bootstrap Tables Examples

Fixed Header Table

Responsive Table

Bootstrap 5 Table With Search And Checkboxes

Is responsive design still a top priority?

Explore the latest responsive design statistics: adoption rates, performance impact, user behavior, and trends shaping modern websites.

See the Numbers →

Minimal Flat Table Design

Adminator – Simple And Elegant Looking Datatable

Table with Vertical & Horizontal Highlight

Table With Collapsible Sections

Fixed Column Table

Pricing Tables

Fade and Blur on Hover Data Table

Responsive & Accessible Data Table

Bootstrap Table V16

Bootstrap 4 Basic Stripped Table With Progressbar

Fresh Bootstrap Table

Bootstrap 4 Team Points Table

Vuetify Vuex Data Table External Pagination & Sort

Looking for a datatable that knows what’s up? You’ve got it here. Sorting, paginations, and some really neat hover actions – it’s all packed into this professional-looking table.

Sortable Tabular Data

Bootstrap Table V18

Data Table

Table light with image background

Colors by List Table

Gentelella – Bootstrap Datatable With Option To Select Rows

How Does Bootstrap Table Component Work

Add the .table class to any HTML table element. The framework’s CSS stylesheet applies predefined styles instantly.

The table component uses a class-based styling system. Stack multiple classes like .table-striped and .table-bordered to combine effects.

Here’s the basic markup structure:

<table class="table">
<thead>
<tr>
<th>Header 1</th>
<th>Header 2</th>
</tr>
</thead>
<tbody>
<tr>
<td>Data 1</td>
<td>Data 2</td>
</tr>
</tbody>
</table>

The thead, tbody, and tfoot sections maintain semantic HTML structure while Bootstrap handles visual presentation.

What Are the Different Bootstrap Table Styles

Bootstrap provides multiple table style variants through modifier classes. Each class targets specific visual characteristics like alternating row colors, borders, and hover states.

Combine these classes for customized data presentation without touching CSS table properties directly.

What is Bootstrap Striped Table

The .table-striped class adds zebra-striping to table rows. Alternating background colors improve readability for data-heavy tables.

<table class="table table-striped">
...
</table>

What is Bootstrap Bordered Table

The .table-bordered class adds borders on all sides of cells. Every row and column gets visible separation lines.

<table class="table table-bordered">
...
</table>

What is Bootstrap Hover Table

The .table-hover class enables a row hover effect. Background color changes when users mouse over rows, helping track data across wide tables.

<table class="table table-hover">
...
</table>

What is Bootstrap Dark Table

The .table-dark class inverts the color scheme. Light text on dark backgrounds works well for user interface designs with dark themes.

<table class="table table-dark">
...
</table>

What is Bootstrap Borderless Table

The .table-borderless class removes all default borders. Clean, minimal look for tables that don’t need cell separation.

<table class="table table-borderless">
...
</table>

How to Create Responsive Bootstrap Table

Wrap tables in a div with .table-responsive class. This enables horizontal scrolling on smaller screens instead of breaking layouts.

<div class="table-responsive">
<table class="table">
...
</table>
</div>

Bootstrap also offers breakpoint-specific classes for targeted responsive behavior:

  • .table-responsive-sm (below 576px)
  • .table-responsive-md (below 768px)
  • .table-responsive-lg (below 992px)
  • .table-responsive-xl (below 1200px)

These media query breakpoints match Bootstrap’s grid system for consistent mobile-first behavior.

What Are Bootstrap Table Contextual Classes

Contextual classes add semantic color coding to rows or individual cells. Each class corresponds to Bootstrap’s color palette for status indication.

Available contextual classes:

  • .table-primary (blue highlight)
  • .table-secondary (gray highlight)
  • .table-success (green, positive status)
  • .table-danger (red, errors or warnings)
  • .table-warning (yellow, caution states)
  • .table-info (cyan, informational)
  • .table-light (light background)
  • .table-dark (dark background)
<tr class="table-success">
<td>Approved</td>
<td>Order #1234</td>
</tr>
<tr class="table-danger">
<td>Rejected</td>
<td>Order #1235</td>
</tr>

Apply contextual classes to tr elements for full-row coloring or td elements for individual cell highlighting.

These color variants maintain proper color contrast ratios for web accessibility compliance.

How to Create Bootstrap Table with Small Size

The .table-sm class cuts cell padding in half. Condensed table layouts fit more data rows in limited vertical space.

<table class="table table-sm">
<thead>
<tr>
<th>ID</th>
<th>Product</th>
<th>Price</th>
</tr>
</thead>
<tbody>
<tr>
<td>001</td>
<td>Widget</td>
<td>$19.99</td>
</tr>
</tbody>
</table>

Combine with other classes like .table-striped or .table-hover for compact, interactive data grids.

How to Create Bootstrap Table Head Styles

Bootstrap offers two table header styling options through dedicated classes.

The .thead-dark class creates light text on a dark background. The .thead-light class applies a subtle gray background to header cells.

<table class="table">
<thead class="thead-dark">
<tr>
<th>Name</th>
<th>Email</th>
<th>Status</th>
</tr>
</thead>
<tbody>
...
</tbody>
</table>

Header styles help establish visual hierarchy between column labels and data cells.

What is Bootstrap Table Group Dividers

The .table-group-divider class adds a thicker border at the top of tbody sections. Creates clear visual separation between the header and body content.

<table class="table">
<thead>
<tr>
<th>Item</th>
<th>Quantity</th>
</tr>
</thead>
<tbody class="table-group-divider">
<tr>
<td>Apples</td>
<td>50</td>
</tr>
</tbody>
</table>

Available in Bootstrap 5.1 and later versions.

How to Nest Tables Inside Bootstrap Table

Place a complete table element inside a td cell. Nested tables inherit no styles from parent tables by default.

<table class="table">
<tbody>
<tr>
<td>Parent Row</td>
<td>
<table class="table table-sm mb-0">
<tbody>
<tr>
<td>Nested Data</td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>

Add .mb-0 to nested tables to remove bottom margin. Apply .table-sm for tighter spacing within cells.

What Are Bootstrap Table Vertical Alignment Options

Bootstrap provides three vertical alignment utility classes for table cells and rows.

  • .align-top (content aligns to cell top)
  • .align-middle (content centers vertically)
  • .align-bottom (content aligns to cell bottom)
<table class="table align-middle">
<tbody>
<tr>
<td class="align-top">Top aligned</td>
<td class="align-bottom">Bottom aligned</td>
</tr>
</tbody>
</table>

Apply to the table element for global alignment or individual cells for specific overrides.

How to Combine Multiple Bootstrap Table Classes

Stack table classes in any order. The Bootstrap framework merges all styles without conflicts.

<div class="table-responsive">
<table class="table table-striped table-hover table-bordered table-sm">
<thead class="thead-dark">
<tr>
<th>Column 1</th>
<th>Column 2</th>
<th>Column 3</th>
</tr>
</thead>
<tbody class="table-group-divider">
<tr class="table-success">
<td>Data A</td>
<td>Data B</td>
<td>Data C</td>
</tr>
</tbody>
</table>
</div>

This example combines striped rows, hover effects, borders, small size, dark header, group divider, contextual row color, and responsive wrapper.

What Are Common Bootstrap Table Implementation Mistakes

Developers frequently encounter these issues when building data table layouts with Bootstrap.

Missing Table Class

Forgetting the base .table class means no Bootstrap styles apply. Other modifier classes like .table-striped require the base class to function.

Responsive Wrapper Placement

The .table-responsive class goes on a wrapper div, not the table element. Placing it directly on the table breaks horizontal scrolling.

Incorrect Thead Class Names

Bootstrap 5 uses .table-dark and .table-light on thead instead of the older .thead-dark and .thead-light syntax from Bootstrap 4.

Ignoring Accessibility Requirements

Tables need proper scope attributes on th elements. Add scope=”col” for column headers and scope=”row” for row headers to support screen readers and meet accessible table standards.

Overriding Framework Styles

Inline styles and competing CSS rules create inconsistent table appearances. Use Bootstrap’s utility classes or create custom CSS overrides through proper specificity instead.

Missing Semantic Structure

Tables without thead, tbody, and tfoot elements lose styling hooks. Always include these wrapper elements even for simple HTML table structures.

FAQ on Bootstrap Tables Examples

How do I add Bootstrap table styling to an existing HTML table?

Add the .table class to your table element. Include Bootstrap’s CSS file via CDN or npm package installation. The framework applies default padding, borders, and typography instantly without additional configuration.

Can I combine multiple Bootstrap table classes together?

Yes. Stack classes like .table-striped, .table-bordered, and .table-hover in any order. Bootstrap merges all styles without conflicts. Most developers combine three to four classes for production-ready data grid layouts.

Why is my Bootstrap table not responsive on mobile devices?

Wrap your table in a div with the .table-responsive class. This enables horizontal scrolling on smaller viewport widths. Placing .table-responsive directly on the table element breaks the functionality.

What is the difference between .thead-dark and .table-dark?

The .thead-dark class styles only the header section. The .table-dark class inverts the entire table including body rows. Bootstrap 5 prefers .table-dark on thead elements instead of the deprecated .thead-dark syntax.

How do I make Bootstrap table rows clickable?

Add .table-hover for visual feedback, then attach JavaScript click event handlers to tr elements. Use cursor: pointer in your stylesheet. The DataTables plugin offers built-in row selection with Ajax data loading support.

Can I use Bootstrap tables with sorting and filtering?

Bootstrap tables provide styling only. For sortable columns and filterable data rows, integrate plugins like DataTables or List.js. These libraries add client-side processing while maintaining Bootstrap’s visual styling.

How do I change Bootstrap table colors to match my brand?

Override CSS variables in your stylesheet or customize Sass source files. Target .table classes with higher specificity rules. Bootstrap 5 uses CSS custom properties that accept direct color value changes without recompiling.

What are Bootstrap table contextual classes used for?

Contextual classes like .table-success, .table-danger, and .table-warning add semantic color coding to rows or cells. Use them for status indicators, validation states, or highlighting specific data points in tabular layouts.

How do I create a fixed header Bootstrap table with scrolling body?

Set a fixed height on the table container with overflow-y: auto. Apply position: sticky and top: 0 to thead. This creates a sticky header effect while the tbody content scrolls independently.

Are Bootstrap tables accessible for screen readers?

Bootstrap tables support accessibility when properly structured. Add scope=”col” to header cells, include caption elements, and use ARIA attributes for complex tables. The framework maintains adequate contrast ratios by default.

Conclusion

These Bootstrap tables examples give you production-ready code for any tabular data display project. Copy the markup, adjust the class combinations, and ship.

The framework handles cross-browser compatibility and cell padding automatically. You focus on the data.

Start with the base .table class. Add .table-striped for alternating row colors, .table-hover for interactive feedback, and wrap everything in .table-responsive for mobile screens.

Contextual classes handle status indicators. Vertical alignment utilities control cell positioning. The class-based styling system keeps your stylesheet clean.

Check the official getbootstrap.com documentation for version-specific updates. Pair tables with other Bootstrap components like cards and forms for complete dashboard layouts.

Author

Bogdan Sandu specializes in web and graphic design, focusing on creating user-friendly websites, innovative UI kits, and unique fonts.Many of his resources are available on various design marketplaces. Over the years, he's worked with a range of clients and contributed to design publications like Designmodo, WebDesignerDepot, and Speckyboy, Slider Revolution among others.