Tables
Example
Use the .table class on a table to style it.
# | Name | Department | |
---|---|---|---|
1 | Michael Scott | worldsbestboss@yahoo.com | Office Manager |
2 | Dwight Schrute | mr.beet@battlestargalactica.com | Sales |
3 | Pam Beesly | pam@dunder-mifflin.com | Reception |
<table class="table"> <thead> <tr> <th>#</th> <th>Name</th> <th>E-mail</th> <th>Department</th> </tr> </thead> <tbody> <tr> <th>1</th> <td>Michael Scott</td> <td>worldsbestboss@yahoo.com</td> <td>Office Manager</td> </tr> <tr> <th>2</th> <td>Dwight Schrute</td> <td>mr.beet@battlestargalactica.com</td> <td>Sales</td> </tr> <tr> <th>3</th> <td>Pam Beesly</td> <td>pam@dunder-mifflin.com</td> <td>Reception</td> </tr> </tbody> </table>
Dark table
# | Name | Department | |
---|---|---|---|
1 | Michael Scott | worldsbestboss@yahoo.com | Office Manager |
2 | Dwight Schrute | mr.beet@battlestargalactica.com | Sales |
3 | Pam Beesly | pam@dunder-mifflin.com | Reception |
<table class="table table-dark">
...
</table>
Small table
# | Name | Department | |
---|---|---|---|
1 | Michael Scott | worldsbestboss@yahoo.com | Office Manager |
2 | Dwight Schrute | mr.beet@battlestargalactica.com | Sales |
3 | Pam Beesly | pam@dunder-mifflin.com | Reception |
# | Name | Department | |
---|---|---|---|
1 | Michael Scott | worldsbestboss@yahoo.com | Office Manager |
2 | Dwight Schrute | mr.beet@battlestargalactica.com | Sales |
3 | Pam Beesly | pam@dunder-mifflin.com | Reception |
<table class="table table-sm">
...
</table>
Bordered table
# | Name | Department | |
---|---|---|---|
1 | Michael Scott | worldsbestboss@yahoo.com | Office Manager |
2 | Dwight Schrute | mr.beet@battlestargalactica.com | Sales |
3 | Pam Beesly | pam@dunder-mifflin.com | Reception |
# | Name | Department | |
---|---|---|---|
1 | Michael Scott | worldsbestboss@yahoo.com | Office Manager |
2 | Dwight Schrute | mr.beet@battlestargalactica.com | Sales |
3 | Pam Beesly | pam@dunder-mifflin.com | Reception |
<table class="table table-bordered">
...
</table>
Borderless table
# | Name | Department | |
---|---|---|---|
1 | Michael Scott | worldsbestboss@yahoo.com | Office Manager |
2 | Dwight Schrute | mr.beet@battlestargalactica.com | Sales |
3 | Pam Beesly | pam@dunder-mifflin.com | Reception |
# | Name | Department | |
---|---|---|---|
1 | Michael Scott | worldsbestboss@yahoo.com | Office Manager |
2 | Dwight Schrute | mr.beet@battlestargalactica.com | Sales |
3 | Pam Beesly | pam@dunder-mifflin.com | Reception |
<table class="table table-borderless">
...
</table>
Striped rows
# | Name | Department | |
---|---|---|---|
1 | Michael Scott | worldsbestboss@yahoo.com | Office Manager |
2 | Dwight Schrute | mr.beet@battlestargalactica.com | Sales |
3 | Pam Beesly | pam@dunder-mifflin.com | Reception |
# | Name | Department | |
---|---|---|---|
1 | Michael Scott | worldsbestboss@yahoo.com | Office Manager |
2 | Dwight Schrute | mr.beet@battlestargalactica.com | Sales |
3 | Pam Beesly | pam@dunder-mifflin.com | Reception |
<table class="table table-striped">
...
</table>
Hoverable row
# | Name | Department | |
---|---|---|---|
1 | Michael Scott | worldsbestboss@yahoo.com | Office Manager |
2 | Dwight Schrute | mr.beet@battlestargalactica.com | Sales |
3 | Pam Beesly | pam@dunder-mifflin.com | Reception |
# | Name | Department | |
---|---|---|---|
1 | Michael Scott | worldsbestboss@yahoo.com | Office Manager |
2 | Dwight Schrute | mr.beet@battlestargalactica.com | Sales |
3 | Pam Beesly | pam@dunder-mifflin.com | Reception |
<table class="table table-hover">
...
</table>
Table heads
# | Name | Department | |
---|---|---|---|
1 | Michael Scott | worldsbestboss@yahoo.com | Office Manager |
2 | Dwight Schrute | mr.beet@battlestargalactica.com | Sales |
3 | Pam Beesly | pam@dunder-mifflin.com | Reception |
# | Name | Department | |
---|---|---|---|
1 | Michael Scott | worldsbestboss@yahoo.com | Office Manager |
2 | Dwight Schrute | mr.beet@battlestargalactica.com | Sales |
3 | Pam Beesly | pam@dunder-mifflin.com | Reception |
<table class="table"> <thead class="thead-dark"> ... </thead> </table> <table class="table"> <thead class="thead-light"> ... </thead> </table>
Captions
# | Name | Department | |
---|---|---|---|
1 | Michael Scott | worldsbestboss@yahoo.com | Office Manager |
2 | Dwight Schrute | mr.beet@battlestargalactica.com | Sales |
3 | Pam Beesly | pam@dunder-mifflin.com | Reception |
<table class="table">
<caption>Employees of Dunder-Mifflin</caption>
<thead>
...
</thead>
</table>
Responsive table
Instead of letting the table overflow its parent, the table can be scrollable. The table is wrapped with a div with the .table-responsive class.
# | Name | Department | |
---|---|---|---|
1 | Michael Scott | worldsbestboss@yahoo.com | Office Manager |
2 | Dwight Schrute | mr.beet@battlestargalactica.com | Sales |
3 | Pam Beesly | pam@dunder-mifflin.com | Reception |
<div class="table-responsive"> <table class="table"> ... </table> </div>
The responsive class can be used with all the breakpoints to make the responsiveness kick in at a certain viewport size.
# | Name | Department | |
---|---|---|---|
1 | Michael Scott | worldsbestboss@yahoo.com | Office Manager |
2 | Dwight Schrute | mr.beet@battlestargalactica.com | Sales |
3 | Pam Beesly | pam@dunder-mifflin.com | Reception |
<div class="table-responsive-sm"> <table class="table"> <thead> <tr> <th>#</th> <th>Name</th> <th>E-mail</th> <th>Department</th> </tr> </thead> <tbody> <tr> <th>1</th> <td>Michael Scott</td> <td>worldsbestboss@yahoo.com</td> <td>Office Manager</td> </tr> <tr> <th>2</th> <td>Dwight Schrute</td> <td>mr.beet@battlestargalactica.com</td> <td>Sales</td> </tr> <tr> <th>3</th> <td>Pam Beesly</td> <td>pam@dunder-mifflin.com</td> <td>Reception</td> </tr> </tbody> </table> </div>