Tham khảo bảng CSS Bootstrap
<bảng> Lớp học
Sử dụng các lớp bên dưới để tạo kiểu cho bất kỳ bảng nào:
Class | Description | Example |
---|---|---|
.table | Adds basic styling (light padding and only horizontal dividers) to any <table> | Try it |
.table-striped | Adds zebra-striping to any table row within <tbody> (not available in IE8) | Try it |
.table-bordered | Adds border on all sides of the table and cells | Try it |
.table-hover | Enables a hover state on table rows within a <tbody> | Try it |
.table-condensed | Makes table more compact by cutting cell padding in half | Try it |
Combining all the table classes | Try it |
Các lớp <tr>, <th> và <td>
Sử dụng các lớp bên dưới để tô màu các hàng hoặc ô của bảng:
Class | Description | Example |
---|---|---|
.active | Applies the hover color (light-grey) to a particular row or cell | Try it |
.success | Indicates a successful or positive action | Try it |
.info | Indicates a neutral informative change or action | Try it |
.warning | Indicates a warning that might need attention | Try it |
.danger | Indicates a dangerous or potentially negative action | Try it |
Bảng đáp ứng
Lớp .table-Responsive tạo ra một bảng phản hồi. Bảng sau đó sẽ cuộn theo chiều ngang trên các thiết bị nhỏ (dưới 768px). Khi xem trên bất kỳ thứ gì có chiều rộng lớn hơn 768px, không có sự khác biệt: