Tables
Basic
A basic table without any styling can be created with just the standard <table>
tag and accompanying elements.
# | First Name | Last Name |
---|---|---|
1 | Keenan | Payne |
2 | John | Doe |
3 | Jane | Doe |
Styled
A styled table with padding and borders can be created by using the .table
class. We have isolated custom table styles into their own class because many JavaScript plugins use tables, and we wanted to avoid styling conflicts.
# | First Name | Last Name |
---|---|---|
1 | Keenan | Payne |
2 | John | Doe |
3 | Jane | Doe |
Full-Width
To create a table that takes up 100% the width of its parent element, simply add the class .table-full
.
# | First Name | Last Name |
---|---|---|
1 | Keenan | Payne |
2 | John | Doe |
3 | Jane | Doe |
Responsive Container
When you have a table with a lot of columns, you may not want to hide columns conditionally or shrink them down to the point where they are unreadable. By wrapping a table in the .table-responsive
class, the size of the table remains the same and a horizontal scroll bar will show up, allowing users to scroll horizontally to view all of the information.
Try resizing the browser and see how the table below changes.
# | First Name | Last Name | Handle |
---|---|---|---|
1 | Keenan | Payne | @keenan_payne |
2 | John | Doe | @johndoe |
3 | Jane | Doe | @janedoe |