Responsive Bootstrap 5 Data Table Example

Ruth Jul 09, 2026

In the ever-evolving landscape of web development, creating responsive tables that display well on various devices is a crucial aspect. Bootstrap 5, the latest version of the popular CSS framework, offers robust tools to achieve this. Let's delve into a practical, SEO-optimized example of a responsive data table using Bootstrap 5.

the dashboard screen shows several different types of web pages and what they mean to be
the dashboard screen shows several different types of web pages and what they mean to be

Before we dive into the code, let's understand why responsive tables are important. With the surge in mobile internet usage, ensuring your tables look good on smartphones and tablets is not just a nice-to-have feature; it's a necessity. Bootstrap 5's responsive utilities and grid system make this possible with minimal effort.

Table concept
Table concept

Setting Up the Bootstrap 5 Environment

First, let's set up our Bootstrap 5 environment. Include the Bootstrap CSS and JS files in your HTML document. You can use the official CDN links provided by Bootstrap:

Responsive Data Table Designs - Sharath Gowda
Responsive Data Table Designs - Sharath Gowda

<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.2.3/dist/css/bootstrap.min.css" rel="stylesheet">
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.2.3/dist/js/bootstrap.bundle.min.js"></script>

Creating a Basic Responsive Table

jQuery Plugins for HTML Tables
jQuery Plugins for HTML Tables

Now, let's create a basic responsive table. Wrap your table in a <div> element with the class 'table-responsive' to enable horizontal scrolling on small devices:

<div class="table-responsive">
<table class="table table-bordered">
<thead>
<tr>
<th>Heading 1</th>
<th>Heading 2</th>
<th>Heading 3</th>
</tr>
</thead>
<tbody>
<tr>
<td>Data 1</td>
<td>Data 2</td>
<td>Data 3</td>
</tr>
</tbody>
</table>
</div>

Adding Scrolling to the Table

a computer screen with an information page on it
a computer screen with an information page on it

By default, Bootstrap 5's responsive table utility enables horizontal scrolling on small devices. However, you can also add scrolling manually using the 'scroll-x' class:

<div class="table-responsive scroll-x">
<table class="table table-bordered">

</table>
</div>

Stripping Down the Table for Smaller Screens

30 Bootstrap Datatable Examples For Web Tables 2026 - uiCookies
30 Bootstrap Datatable Examples For Web Tables 2026 - uiCookies

In some cases, you might want to simplify your table for smaller screens. You can use the 'd-none' class to hide columns on small screens and the 'd-sm-table-cell' class to show them on medium and larger screens:

<th class="d-none d-sm-table-cell">Heading 3</th>
<td class="d-none d-sm-table-cell">Data 3</td>

Data Table UI Design Guide & 30+ Examples
Data Table UI Design Guide & 30+ Examples
Elite Admin - Bootstrap 5 Dashboard template
Elite Admin - Bootstrap 5 Dashboard template
Bootstrap Crud Data Table for Database with Modal Form Template
Bootstrap Crud Data Table for Database with Modal Form Template
data table simplify with Vue.js - Vue.js Examples
data table simplify with Vue.js - Vue.js Examples
an image of a dashboard with graphs and pies on the screen, as well as other data
an image of a dashboard with graphs and pies on the screen, as well as other data
Rocker - Bootstrap 5 Admin Dashboard Template
Rocker - Bootstrap 5 Admin Dashboard Template
two screens showing different types of webpages and the same type of website page
two screens showing different types of webpages and the same type of website page
CSS Tables
CSS Tables
Table UI Example
Table UI Example
Designing Complex Responsive Tables In WordPress — Smashing Magazine
Designing Complex Responsive Tables In WordPress — Smashing Magazine
5 Practical Solutions to Make Responsive Data Tables
5 Practical Solutions to Make Responsive Data Tables
an image of a website page with many different items on the screen and numbers in red
an image of a website page with many different items on the screen and numbers in red
Dashboard Data Table UI Design (Light and Dark Mode) | Boltstack.dev
Dashboard Data Table UI Design (Light and Dark Mode) | Boltstack.dev
Data Table & Pricing Table Keynote
Data Table & Pricing Table Keynote
Applying UX Principles to Data Tables
Applying UX Principles to Data Tables
a table that has some important things to know about it and how they are used
a table that has some important things to know about it and how they are used
Data table V2: Canceling batch action doesn't remove selected class from rows · Issue #675 · carbon-design-system/carbon
Data table V2: Canceling batch action doesn't remove selected class from rows · Issue #675 · carbon-design-system/carbon
I will do dashboards in google sheets | Business | Fiverr Solutions
I will do dashboards in google sheets | Business | Fiverr Solutions
the screenshot shows an image of several different types of numbers and words in each column
the screenshot shows an image of several different types of numbers and words in each column
an image of a dashboard showing the number of items available for each user in their website
an image of a dashboard showing the number of items available for each user in their website

Using the 'colspan' Attribute for Simplified Layouts

Another approach is to use the 'colspan' attribute to combine cells into one on smaller screens:

<td colspan="2">Data 1 and 2</td>

In conclusion, creating responsive data tables with Bootstrap 5 is a breeze. By utilizing the responsive utilities and grid system, you can ensure your tables look great on all devices. Start experimenting with these techniques to create engaging and functional web experiences. Happy coding!