Bootstrap 3 Tutorial
A basic Bootstrap table has little padding and only horizontal divisions.
The .table class provides basic style for a table:
| Firstname | Lastname | |
|---|---|---|
| John | Doe | john@example.com |
| Mary | Moe | mary@example.com |
| July | Dooley | july@example.com |
The .table-striped class adds zebra stripes to a table.
| Firstname | Lastname | |
|---|---|---|
| John | Doe | john@example.com |
| Mary | Moe | mary@example.com |
| July | Dooley | july@example.com |
The .table-bordered class adds borders to all sides of the table and cells.
| Firstname | Lastname | |
|---|---|---|
| John | Doe | john@example.com |
| Mary | Moe | mary@example.com |
| July | Dooley | july@example.com |
The .table-hover class applies a hover effect (gray background color) to table rows:
| Firstname | Lastname | |
|---|---|---|
| John | Doe | john@example.com |
| Mary | Moe | mary@example.com |
| July | Dooley | july@example.com |
The .table-condensed class makes a table more compact by reducing cell padding by half:
| Firstname | Lastname | |
|---|---|---|
| John | Doe | john@example.com |
| Mary | Moe | mary@example.com |
| July | Dooley | july@example.com |
Table rows (<tr>) and cells (<td>) can be colored using contextual classes.
The following contextual classes can be used:
| Class | Description |
|---|---|
.active |
Applies the hover color to the table row or table cell |
.success |
Indicates a successful or positive action |
.info |
Indicates a neutral informative change or action |
.warning |
Indicates a warning that might need attention |
.danger |
Indicates a dangerous or potentially negative action |
The .table-responsive class generates a responsive table. On small devices (768px or less), the table will scroll horizontally. When viewing on anything larger than 768 pixels wide, there is no change:
The following contextual classes can be used:
...
For a complete list of all table classes, see our Bootstrap Tables Reference.
CodingAsk.com is designed for learning and practice. Examples may be made simpler to aid understanding. Tutorials, references, and examples are regularly checked for mistakes, but we cannot guarantee complete accuracy. By using CodingAsk.com, you agree to our terms of use, cookie, and privacy policy.
Copyright 2010-2024 by Refsnes Data. All Rights Reserved.