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 |
# | 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>
Variants
# | 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 |
# | 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 |
Class | Heading | Heading |
---|---|---|
Default | Cell | Cell |
Primary | Cell | Cell |
Secondary | Cell | Cell |
Success | Cell | Cell |
Danger | Cell | Cell |
Warning | Cell | Cell |
Info | Cell | Cell |
Light | Cell | Cell |
Dark | Cell | Cell |
Beets | Cell | Cell |
<table class="table table-dark">...</table> <tr class="table-dark">...</tr> <tr> <td class="table-dark">...</td> </tr>
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 head
# | 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="table-dark"> ... </thead> </table> <table class="table"> <thead class="table-light"> ... </thead> </table>
Table foot
# | 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 |
Footer | Footer | Footer | Footer |
<table class="table"> <thead> ... </thead> <tbody> ... </tbody> <tfoot> ... </tfoot> </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>