Table Basic

Documentation and examples for opt-in styling of tables (given their prevalent use in JavaScript plugins) with Bootstrap. Read the Official Bootstrap Documentationfor a full list of instructions and other options.


Basic Example

Using the most basic table markup, here’s how .tablebased tables look in Bootstrap. All table styles are inherited in Bootstrap 4, meaning any nested tables will be styled in the same manner as the parent.

IDNameJob TitleDegreeSalary
1Adrian MoninoFront-End EngineerComputer Science$120,000
2Socrates ItumaySoftware EngineerComputer Engineering$150,000
3Reynante LabaresProduct ManagerBusiness Management$250,000
4Hamza MacasindilSoftware EngineerComputer Engineering$140,000
5Roven GaleonProject ManagerAccountancy$160,000
<table class="table">  <thead>    <tr>      <th scope="col">ID</th>      <th scope="col">Name</th>      <th scope="col">Job Title</th>      <th scope="col">Degree</th>      <th scope="col">Salary</th>    </tr>  </thead>  <tbody>    <tr>      <th scope="row">1</th>      <td>Adrian Monino</td>      <td>Front-End Engineer</td>      <td>Computer Science</td>      <td>$120,000</td>    </tr>    <tr>      <th scope="row">2</th>      <td>Socrates Itumay</td>      <td>Software Engineer</td>      <td>Computer Engineering</td>      <td>$150,000</td>    </tr>    <tr>      <th scope="row">3</th>      <td>Reynante Labares</td>      <td>Product Manager</td>      <td>Business Management</td>      <td>$250,000</td>    </tr>  </tbody></table>

Table Head Options

Similar to tables and dark tables, use the modifier classes .thead-primaryor .thead-darkto make colored head.

IDNameJob TitleDegreeSalary
1Adrian MoninoFront-End EngineerComputer Science$120,000
2Socrates ItumaySoftware EngineerComputer Engineering$150,000
3Reynante LabaresProduct ManagerBusiness Management$250,000
<thead class="thead-primary">...</thead>
Class ReferenceColor
class="thead-[color]"primary | secondary | success | danger | warning | info | light | dark

Striped Rows

Use .table-stripedto add zebra-striping to any table row within the tbody.

IDNameJob TitleDegreeSalary
1Adrian MoninoFront-End EngineerComputer Science$120,000
2Socrates ItumaySoftware EngineerComputer Engineering$150,000
3Reynante LabaresProduct ManagerBusiness Management$250,000
4Hamza MacasindilSoftware EngineerComputer Engineering$140,000
5Roven GaleonProject ManagerAccountancy$160,000
<table class="table table-striped">...</table>

Bordered Table

Add .table-borderedfor borders on all sides of the table and cells.

IDNameJob TitleDegreeSalary
1Adrian MoninoFront-End EngineerComputer Science$120,000
2Socrates ItumaySoftware EngineerComputer Engineering$150,000
3Reynante LabaresProduct ManagerBusiness Management$250,000
4Hamza MacasindilSoftware EngineerComputer Engineering$140,000
5Roven GaleonProject ManagerAccountancy$160,000
<table class="table table-bordered">...</table>

Hoverable Rows

Add .table-hoverto enable a hover state on table rows within a tbody.

IDNameJob TitleDegreeSalary
1Adrian MoninoFront-End EngineerComputer Science$120,000
2Socrates ItumaySoftware EngineerComputer Engineering$150,000
3Reynante LabaresProduct ManagerBusiness Management$250,000
4Hamza MacasindilSoftware EngineerComputer Engineering$140,000
5Roven GaleonProject ManagerAccountancy$160,000
<table class="table table-hover">...</table>

Compact Table

Add .table-smto make tables more compact by cutting cell padding in half.

IDNameJob TitleDegreeSalary
1Adrian MoninoFront-End EngineerComputer Science$120,000
2Socrates ItumaySoftware EngineerComputer Engineering$150,000
3Reynante LabaresProduct ManagerBusiness Management$250,000
4Hamza MacasindilSoftware EngineerComputer Engineering$140,000
5Roven GaleonProject ManagerAccountancy$160,000
<table class="table table-sm">...</table>

Colored Variations

Use contextual classes to color entire table.

IDNameJob TitleDegreeSalary
1Adrian MoninoFront-End EngineerComputer Science$120,000
2Socrates ItumaySoftware EngineerComputer Engineering$150,000
3Reynante LabaresProduct ManagerBusiness Management$250,000
4Hamza MacasindilSoftware EngineerComputer Engineering$140,000
5Roven GaleonProject ManagerAccountancy$160,000
IDNameJob TitleDegreeSalary
1Adrian MoninoFront-End EngineerComputer Science$120,000
2Socrates ItumaySoftware EngineerComputer Engineering$150,000
3Reynante LabaresProduct ManagerBusiness Management$250,000
4Hamza MacasindilSoftware EngineerComputer Engineering$140,000
5Roven GaleonProject ManagerAccountancy$160,000
<table class="table table-[color]">...</table>
Class ReferenceColor
class="table table-[color]"primary | secondary | success | danger | warning | info | light | dark

Responsive Table

Responsive tables allow tables to be scrolled horizontally with ease. Make any table responsive across all viewports by wrapping a .tablewith .table-responsive.

IDNameJob TitleDegreeSalary
1Adrian MoninoFront-End EngineerComputer Science$120,000
2Socrates ItumaySoftware EngineerComputer Engineering$150,000
3Reynante LabaresProduct ManagerBusiness Management$250,000
4Hamza MacasindilSoftware EngineerComputer Engineering$140,000
5Roven GaleonProject ManagerAccountancy$160,000
<div class="table-responsive">  <table class="table">...</table></div>