Bootstrap Table Guide And Best Bootstrap Table Examples
Tags: bootstrap, javascript, webdev
Published: 2021-05-13 08:41:35

---
title: Bootstrap Table Guide And Best Bootstrap Table Examples
published: true
description: Tables are an important part of any web application’s life. Tables organize and present content in a way that’s easy for readers to quickly scan and absorb large amounts of data. We can say that tables are the foundation of a modern web application. 
tags: bootstrap, js, webdev
//cover_image: https://direct_url_to_image.jpg
canonical_url: https://flatlogic.com/blog/bootstrap-table-guide-and-best-bootstrap-table-examples/
---

Tables are an important part of any web application’s life. Tables organize and present content in a way that’s easy for readers to quickly scan and absorb large amounts of data. We can say that tables are the foundation of a modern web application. Therefore, it is very important to make them carefully and with love. After we’ve reviewed the best javascript table plugins, we decided to create a digest of the best tables out there, categorised by one technology. Here it is: today we will talk about Bootstrap tables.

Bootstrap table is good for creating date pickers, admin panels, calendars, and all other stuff to show complex data.

In this article, you will learn what a bootstrap table is, how to make basic bootstrap tables and how to make them beautiful. You will also learn how to customize bootstrap tables. After that, we will list the best examples of ready-made bootstrap tables.

##What is a bootstrap table? A basic example of Bootstrap table

Bootstrap tables are well-organized components for displaying data. The data is presented in the form of columns and tables. Bootstrap tables are opt-in. To build it, you just need to add `<.table>` class to any `<table>` and then style it.

The code example of the basic Bootstrap table looks like this:
```
<table class="table">
  <thead>
    <tr>
      <th scope="col">#</th>
      <th scope="col">Name</th>
      <th scope="col">Surname</th>
      <th scope="col">Username</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <th scope="row">1</th>
      <td>Eugene</td>
      <td>Stepnov</td>
      <td>@e93</td>
    </tr>
    <tr>
      <th scope="row">2</th>
      <td>Mark</td>
      <td>Dever</td>
      <td>@md111</td>
    </tr>
    <tr>
      <th scope="row">3</th>
      <td>John</td>
      <td>Piper</td>
      <td>@piper</td>
    </tr>
  </tbody>
</table>
```

![](https://lh3.googleusercontent.com/LsgcB6_45x04wl4BYYyQHUanHd-Tpc88OCR9VShDRKT3Cq8IozvzaGpDXNTTgvbK0NS1fZ74CGcJ5h1NTcUpGC1Ye5U0Gp5adKj49VGf-nJfdx2JiLnxoICN21_unKR1wUtKMBI0)

##Bootstrap Table Classes

The basic principle when developing a bootstrap table is classes. You don’t need to write cumbersome CSS to style and customize your table. Just add classes to the <table> tag describing how the table will behave. For example, here are the most popular classes:

Border: Add a border with `.table bordered`;

Colors: Add color to different rows with `.table striped`;

Condense: Make your rows more compact with `.table-condensed`;

Hover: Highlight a table sortable line when you hover with `.table-hover`.

Next, we’ll look at how to put these classes into practice.

##Types of bootstrap table

Now let’s take a look at different basic manipulations with Bootstrap table.

##Striped rows and dark table

For creating a striped row table you just need to add `.table-striped` to any table row within the `<tbody>`. You can also add the table dark class to make the table dark and invert the colors.

```
<table class="table table-dark table-striped">
  <thead>
    <tr>
      <th scope="col">#</th>
      <th scope="col">Name</th>
      <th scope="col">Surname</th>
      <th scope="col">Username</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <th scope="row">1</th>
      <td>Eugene</td>
      <td>Stepnov</td>
      <td>@e93</td>
    </tr>
    <tr>
      <th scope="row">2</th>
      <td>Mark</td>
      <td>Dever</td>
      <td>@md111</td>
    </tr>
    <tr>
      <th scope="row">3</th>
      <td>John</td>
      <td>Piper</td>
      <td>@piper</td>
    </tr>
  </tbody>
</table>
```

![](https://lh5.googleusercontent.com/yghCRi4snqJFWYDV-uliwQ9H8fMtMzq5jcojfhAOsfYwaxtFWDfw6Zmv1hb5gKR9r3AIXX-p3PjyfbnEFVrNbpzdZnsQ0npDwg0292BDF172nKwktCrnyQEfj-G_5QwkJKqzqkH8)

###Bordered and borderless bootstrap table

To add borders to a table, use the `.table-bordered class`. In this case, the table tag will look like this
```
<table class="table table-bordered">
...
</table>
```

![](https://lh6.googleusercontent.com/V8VBzjt6_z_f8HaWENGYl-tYD1nZXezNHrWfS06zWEhMSy7Y8tY8L0PNJdAw7fzXoPRbAHs3UBLNS-njtqvGqmb8MM4Bblqc4qSZGainrnoBlnVu0m3ZeidMaSwA5feezCUyy53H)

For the borderless table, you should use:
```
<table class="table table-borderless">
...
</table>
```

![](https://lh5.googleusercontent.com/-6c77vgp19hIGedQbsHYTXNDr1TzwcONUB7nDC4AFUPKrrrrMAMhrsHmMIAYrcPHRph_S0Z8ITYK9QKGDPZawIlzRXw7VyrhZCtTBeGpiNPksVxC0zbKXd5Un3XcW6CFRTIUiDGH)

###Contextual bootstrap table classes

You can also use contextual classes to colorize individual lines or cells. It’s also worth mentioning that you can use several different classes at the same time to build a wide variety of tables.

To make a colorized table, you can apply the following classes to `<tr>` elements (rows) or `<td>` elements (individual cells):

```
.Table-primary
.Table-secondary
.Table-success
.Table-danger
.Table-warning
.Table-info
.Table-light
.Table-dark
```

In our example below, we have made a small table with a hover, using 3 context classes to colorize individual lines.

```
<table class="table table-sm table-hover">
  <thead>
    <tr>
      <th scope="col">#</th>
      <th scope="col">Name</th>
      <th scope="col">Surname</th>
      <th scope="col">Username</th>
    </tr>
  </thead>
  <tbody>
    <tr class="table-danger">
      <th scope="row">1</th>
      <td>Eugene</td>
      <td>Stepnov</td>
      <td>@e93</td>
    </tr>
    <tr class="table-success">
      <th scope="row">2</th>
      <td>Mark</td>
      <td>Dever</td>
      <td>@md111</td>
    </tr>
    <tr class="table-warning">
      <th scope="row">3</th>
      <td>John</td>
      <td>Piper</td>
      <td>@piper</td>
    </tr>
  </tbody>
</table>
```

![](https://lh6.googleusercontent.com/oQ9uH--LhJbMClZ2suzvGA6vJIjO8Td0sQHqYknpIoHUkINec4ZgT8dwgECPEYFH074xH0vIjrp0SKYCjgKP63vFtlcwGLUgx3dnWdclF2fCYrVOUpVK5iSii6GnApzIfru7T6T3)

###Bootstrap table heads color

You can also specify different background colors for the table head using the modifier classes `.thead-light` or `.thead-dark` on the `<thead>` element.

The following example uses the class .thead-light to create a table with a light head.

```
<table class="table table-dark table-striped">
  <thead class="thread-light">
    <tr>
      ...
    </tr>
</table>
```

![](https://lh5.googleusercontent.com/1PW3I3VUUEB_5P3XEj06h5mvC9e7DgxCeXf0CfTYah5U3xPaHWJmlTdFqOWi0bP5FNOiRdi5xVfqjoG79rBw9hT_Jl-BTvWajg8hPYs_Y6Ff2fjiAXcDyYJ6Ize4LD873C_5mXc9)

Likewise, you can use the class `.thead-dark` to create a table with a dark head.

```
<table class="table table-dark table-striped">
  <thead class="thread-dark">
    <tr>
      ...
    </tr>
</table>
```

![](https://lh5.googleusercontent.com/IyoHj5ctAfHtbKvZCAjuM8Pvn6Z0Y6X8yW1otvJgxW35oYZsl6McYqjymZrbL7ABrHqVdqne3Q9Eefsmn-T-vXUydXU8m2EKwJ1oFZI2c56WKLHCaojQnwqECnqbqgmRDhnKHSy7)

###Hoverable rows

Sometimes you need to highlight some rows of a table. Then we need to use `:hover`. In bootstrap, you don’t need to modify anything in the CSS file: just add the .table-hover class to the `<table>` tag

```
<table> tag

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

![](https://lh3.googleusercontent.com/g5LnFtlWb2HvcmJtiVVGM6o1ggUmkq_ePKgH5p_5QhZS3n9SsEhn5Vt4etpHINT2sj76cdYfwD7vM-gUhlDAc1UWbmiW_47wjcrPgfq1pQFo61flx2rqXIiUt3t49VVmt-2s0ioM)

###Small bootstrap table

If you want to develop a small compact table, just add class `.table-sm`.

```
<table class="table table-sm">
...
<table/>
```

###Responsive bootstrap table

One thing you simply need to know about is responsive bootstrap tables. To make any table responsive, wrap the `<table>` tag in a `<div>` with the class `.table-responsive`. Or you can specify the maximum breakpoint at which this table property will appear by adding the class `.table-responsive {-sm | -md | -lg | -xl}`. Look at an example below.

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

###Bootstrap table with images

Adding images to a table, make sure you specify a max-width for the parent cell. You can use the sizing utilities or write your own CSS. By default, the content in a table cell is vertically aligned to the top.

```
<table class="table table-image">
      <thead>
        <tr>
          <th scope="col">Number</th>
          <th scope="col">Avatar</th>
          <th scope="col">First Name</th>
          <th scope="col">Last Name</th>
          <th scope="col">Username</th>
          <th scope="col">Social Link</th>
        </tr>
      </thead>
      <tbody>
        <tr>
          <th scope="row">1</th>
          <td class="w-25">
<img src="https://s7d9.scene7.com/is/image/LifeWayChristianResources/piper_john_author?wid=300&hei=300&op_usm=2,.5,6,0" alt="John Piper">
          </td>
          <td>John</td>
          <td>Piper</td>
          <td>@johnpiper</td>
          <td>twitter</td>
        </tr>
        <tr>
          <th scope="row">2</th>
          <td class="w-25">
<img src="https://www.capitolhillbaptist.org/monkimage.php?mediaDirectory=mediafiles&mediaId=3241749&fileName=mark-dever-2-300-300-0-0.jpg" class="img-fluid img-thumbnail" alt="Mark Dever">
          </td>
          <td>Mark</td>
          <td>Dever</td>
          <td>@markdever</td>
          <td>twitter</td>
        </tr>
      </tbody>
</table>
```

![](https://lh6.googleusercontent.com/Jlny8Y_xZEWXq13-V5lUYqL65upSrRIVc22r-o7c18pu3QQ8FTxV1Ukkk-r2M_JNooiEAlBId90WActVchMEOz19ylo1HBXac3TeOX72Dr2SW9lMinVh1AphzKm8YYtapDVnzjeD)

##Common questions about bootstrap table
###How to style a bootstrap table?

To style the bootstrap table, add various classes to the `<table>`, `<th>`, `<tr>` tags. For example, the `.table-sm` class will make your table compact. For more details refer to the official bootstrap documentation.

###What is table responsive in Bootstrap?

Table responsive allows any table to scroll horizontally. To make any table responsive just add `.table-responsive` class to `<table>` tag.

###How do I add a border to a bootstrap table?

To add borders to the table, use the `.table-bordered` class on the `<table>` tag

###How do I center the text bootstrap table?

The easiest way to center text in the bootstrap table is to add `.text-center` class in the `<table>` tag.

###How do I make a scrollable table in bootstrap?

Use a responsive table to add scroll. Just add `.table-responsive` class to a `<table>` tag.

##Best Bootstrap Table Examples
###Bootstrap table

![](https://lh6.googleusercontent.com/kdOdOknF7wwneM5E7CLWciNXlg98kHr9c9OaTHlNrYE2sCvw1QflPAPWjl3cxBXAkfcTVtdpE_cjqPg-Ow_ndPteulIxD0YdKjydVQOFhd8V6z9KkMqjXpCmqX86UOVnycnnAfNr)

The bootstrap table is a plugin for integration with the most popular CSS frameworks. It is an extended version of the table that integrates with many CSS frameworks. It supports Material Design, Bootstrap, Bulma, Semantic UI, and Foundation. You can install it with npm or yarn by using the Bootstrap Table source JavaScript files and CSS.

One of the most important things about this plugin is that you make the table fully responsive in a very short time. The plugin is maintained by thousands of contributors and it has thousands of commits. The other good thing is that this library has great documentation with many live examples with source code on how to use this plugin. For instance, there are examples of a Modal table, different use of buttons, how to add search, merge or update cells, and other features that can extend your bootstrap table.

####Notable features:
* responsive web design;
* scrollable table with fixed headers;
* fully configurable via data attributes;
* get data in JSON format using AJAX;
* simple column sorting with a click;
* powerful pagination and localization.

###Bootstrap tables in Light Blue Bootstrap Admin Template

![](https://lh4.googleusercontent.com/J0YBpwLHNMEQSTZwpsJPD4YYK2xRiPq9Gh3Jw-5MUfk3qCSwjLn7NFAhOu8nukDWEnrgrl-k_p-utSee9bOqqJrkMaMZE8uwhnQVDwwLv85kOcWNvFcoanxQ5wL8YYqnqQy7fqzR)

Light Blue HTML5 Admin Template is a product developed by Flatlogic, made in dark and transparent colors. The template is made on the basis of Bootstrap 4 and is fully responsive. In addition to tables, you will find many other components in this template such as buttons, icons, dashboards and others.

As for tables, in this template,​ they are subdivided into Tables Basic and Tables Dynamic.

In Tables Basic you will find static bootstrap tables with the following features:

* Tables with buttons;
* Tables with images;
* Striped and bordered tables;
* Hover and overflow tables;
* Tables with checkboxes.

In Tables Dynamic section you will find the following features:

* Sortable tables;
* Working search console;
* Tables made on top of Backgrid.js;
* Tables made on top of jQuery DataTables.

As a result, using this template, you get not only different types of well-designed bootstrap tables, but also a well-thought-out admin panel for a full-fledged web application with different components.

###MDbootstrap bootstrap table generator

![](https://lh6.googleusercontent.com/RGK40hia7LeApp1qxq1NTaZNAprsCFrQbBk-SoTTu9K55BZ2CouIzS8ehGQ_GWi3KI496090wpLhhAaN9feX1a1SEMnbdQNy4_rpBHpyBpes6FPSPv3RsQS5qg8RcQwubZP5uRSE)

This tool allows you to quickly generate a bootstrap table to see how it will look, and copy the resulting code. The tool can create tables using the following combinations of bootstrap classes:

* Striped
* Hoverable
* Bordered
* Borderless
* Small
* Responsive
* Captions
Also, in addition to this, you can choose the color of cells and borders. This tool will be very helpful if you want to test different table styles.

###Fixed Column Bootstrap Table by Colorlib

![](https://lh4.googleusercontent.com/tgTjTKqqtJkEUGHqTPYzuwnC_bca76cKSegPJtqtDbIyV5Vga5-LKb_0TznzHfktiFg5E0EDiRHDQYmArL8X5AvXo2TYw5cCB6aPRalDlKRvh_X7EOAMkPQnRcHhge0ZFPWeQy9W)

The table is well suited for displaying huge data arrays since it’s not always possible to remember which cell corresponds to which one. This is why the first column is fixed while you scroll horizontally. It is fully customizable, allowing you to use any color you choose, or create a responsive table and add rows if necessary.

It uses Bootstrap and Fontawesome. The scroll is implemented with jQuery.

The product is completely free. To download and run it, you will need to leave your email on the site.

###Bootstrap 4 static table with checkboxes and fixed header

![](https://lh3.googleusercontent.com/tZFONhbmUji1daYp4yX-_nPKq9gZ7x0Pg0xLz954rsyS6CIvq6HQnwoqxNcXgmSNgrnIXXMg7D4b_eHo6GhvibjrQRP_CAnfJkkUOS-p14YzdGWjR16NObGHD12ncvd1K1ikF6a_)

Fixed header and checkboxes tables are featured in one of the largest bootstrap communities. The table has very accurate design and good user experience. The table uses Bootstrap 4 and Jquery. This snippet is free and open-source – you can use it in your project. The project has integration with FontAwesome and includes more than 1000+ images.

###Creative Tim bootstrap table

![](https://lh3.googleusercontent.com/M1KplbfrYuVRZWxMjp_P361mE2xnUQmJxDHKjnFBZOkWz534WQu3fQYLQrd3CyROWuExeazz5ybOJi4FcYGfgW_LAg-CHrcHfuqYUnku1tGNqs5yITdVU3M1_5GgMRQ8iq05h5kX)

This Bootstrap table is based on the bootstrap table plugin. The project is completely free and open-source, nevertheless it has wide functionality. You can set background color (5 colors), the background of the table can be created from scratch, or you can leave only the header. Also, the table can run either in full screen mode or compact. This table has all the functionality of bootstrap – table plugin.

###Bootstrapious Pricing table

![](https://lh5.googleusercontent.com/VSgFgYLMZjD24zQYdyxjcOqxczLIU87bcF4BXJnRFOFcqAiFKJobuh54Y9KJ0RUSX6jygq44vRRqQc8lF-crSaPpmVRcTpwF28-fteqFzCOY3FRCTNjOd24IZ9y-_LY9AWTYlf1c)

Fixed Header Bootstrap Table Template has – guess what – a fixed header that gives you the ability to scroll vertically. The table has rounded corners, and it is also possible to change table color and use different color combinations. There is no column border in the variants, which allows you to add as much content as you like without getting cut off. The columns simply adjust themselves to keep the table looking impressive.

###Sortable

![](https://lh3.googleusercontent.com/1nScg9NfK6Oecx-GPIP3zO1Huh8bakNHStYU56_RFko5xlWZyGRaaOsHvoE-bcHVJjE0rkTiU4ZnuOtChcpZfJmo_G3Pfrg6VhsubW3VZLfa30Mj7AY80OXP2fcOI6YE98ux6uJd)

This small bootstrap table has important functionality, namely the ability to sort the various columns of the table. This function is done with a little bit of jQuery code:

```
$(function(){
  $('#keywords').tablesorter(); 
});
```

###Fade and Blur on Hover Data Table

![](https://lh4.googleusercontent.com/3jUSKz3sgwb2_B6uRQOOTWzFvra3bzxeC1ShQo16AgiabnPjuzztXGbGUPixAKjiJO8jBOUjIVxkxeGYOZYKKfwQYXYmMBovcwhldQKjskSomSb_E0WsjRrWVY38EHXz1FbonXEi)

This table has a strict corporate design that can be suitable for large, serious applications. Of course, you can change the color configuration settings and choose your theme from unlimited custom combinations that will deliver the right look for your table.

However, the main feature of this table is this: when you hover over a row, it will be highlighted by fading out the others. This will allow your users to focus better and clearly see what they are reading.

###Fixed column datatable

![](https://lh3.googleusercontent.com/MO-IurMAkpAz03Vy-ruLydhKuZUOAZ_cEUYyqjXh7creZmOlYnhJTltd2lDV6ZE91hqGOMA2DdvF6_ytaYnQx-cqPrMcPdPErLa3ZxnAnwBj2j3_uHM4QFQgAOI42b9nxT2Ij6Gp)

In this template you will find 6 different example tables. This is a plugin written in Vue and Bootstrap. By using this template you get a data table with checkboxes, a data table with accordion, and data tables with different column alignment. The code script for all six designs is shared as a single code file. The template is fully customizable and responsive.

###Bootstrap datagrid

![](https://lh4.googleusercontent.com/iJBfICe1kR9tNL8XUczc8z3SSkP-ZmdSia9mzgucQ_FDqIOMubp0f8FzssbKzA81amUOti4sE7moQsBD-TTZmAaHSTBTpX3LrTHPPzGLZ8k4bjxJKdKgCHIO9VH9sm0yCK6e2mjg)

Bootstrap datagrid is a jQuery datagrid plugin compatible with Bootstrap 2 and 3. It is completely free and open source, available under MIT license. The disadvantage of this tool is no Bootstrap 4 support. The plugin is completely responsive and fully configurable. The features of the plugin include sorting, filtering, change columns order, show or hide columns, single or multiple row selection, filters, localization, pagination, and more. As a bonus, Bootstrap datagrid has neat documentation.

###React bootstrap table

![](https://lh6.googleusercontent.com/lMe68fnureKUbz_Zd5yJS_Lo85ffi9xKTpZqcsJen0fGN-7iHPLqEqgNii_yfMxgAV8-75n0wSHNgPHEICESaDU3xNvfLm5EbXYdUeHL-4cnTFrQRf60YNLvKDSVtGEGviMa1Y7O)

A very useful tool indeed: react and bootstrap are the two most popular front end libraries. React bootstrap table allows you to create bootstrap style tables inside the React application. It works with Bootstrap 3 and 4. The installation, configuration and usage are very intuitive.

React bootstrap table supports following built-in features:

* Striped, borderless, condensed table;
* Column align, hidden, width, sort, title, styling, customization;
* Table scrolling;
* Cell format;
* Pagination;
* Row selection;
* Table Search, Column filter;
* Cell editor;
* Insert & delete Row;
* Export to CSV;
* Rich function hooks;
* Header column span;
* Remote mode;
* Row expand;
* Keyboard navigation.

###Footable

![](https://lh4.googleusercontent.com/yJnBcVi820OhDde5YWWgsknOrefeVnm-CrKYcRj_UX9yY6IH7meCvgVmaK0z5BDQmZ6AGxoYmEdJ8YbwpI_k9OxfUF8WYs1azih6Wp9tc89b1A9qLVUNC4_rGA9dO9aHmzKeKylT)

FooTable is a responsive plugin built for Bootstrap. The table is free to download and fully responsive. The features of this table include searching within the table, searching by category, pagination, sorting in individual columns and tag indicating the number of entries. The table displays 10 entries at a time, which can be changed according to your needs.

###Js grid

![](https://lh3.googleusercontent.com/uw3vHaONlEAJWNnvHKz7dwZLThdLnyLeCP5kyLHRkqpD5-Sf-8tBYBWlKn9voBZPpLrfw_Y6X4u1HbE2bIM_8iJSz9NLj3Gxy2XR_XhHnwlq_L3dH_V_tiV-vfa-9naQ5EsWeZpW)

jsGrid is a jQuery plugin you can add to your Bootstrap site. The plugin has a lot of basic features for tables such as sorting, searching, pagination, scrolling the entries, etc. Additional features of the table include data editing, validation, filtering, etc.

The plugin has very good documentation. Despite the fact it is written in jquery, there are still periodic updates.

##Conclusion
In this article, we introduced you to the concept of Bootstrap table, as well as basic manipulations with it and various ready-made templates as a bonus.

When you create your table, we recommend you to think of what information will be the most important in it, and only then decide which features and elements to use. You can also choose bootstrap tables with more advanced options, including search, pagination, or sort features.

As for your ready-made examples of bootstrap tables, the best tables are the ones you customize yourself: because you know best what will suit your website and your vision.

If you want to somehow improve and comment on this article, we’ll be very happy to hear from you. You can also find many examples of bootstrap tables by looking at our bootstrap templates.

__________

#About Flatlogic

At Flatlogic, we help businesses to speed up web development with our beautifully designed web & mobile application templates built with [React](https://flatlogic.com/templates/react), [Vue](https://flatlogic.com/templates/vue), [Angular](https://flatlogic.com/templates/angular), [React Native](https://flatlogic.com/templates/react-native), and [Bootstrap](https://flatlogic.com/templates/bootstrap). During the last several years we have successfully delivered more than 100 custom dashboards and data management solutions to various clients starting from innovative startups to established and respected enterprises.

{% youtube WpVQsS-Bb3U %}

_____________

**You might also like these articles:**
[Top 24 Free Essential Plugins To Extend Bootstrap](https://dev.to/flatlogic/top-24-free-essential-plugins-to-extend-bootstrap-4mn6)
[37 Simple And Useful Table Templates & Examples For Web Developers](https://dev.to/flatlogic/37-simple-and-useful-table-templates-examples-for-web-developers-i3j)
[Top 13+ Login Pages Design Examples](https://dev.to/flatlogic/top-13-login-pages-design-examples-57ip)