Menu
×
   ❮     
HTML CSS JAVASCRIPT SQL PYTHON JAVA PHP HOW TO W3.CSS C C++ C# BOOTSTRAP REACT MYSQL JQUERY EXCEL XML DJANGO NUMPY PANDAS NODEJS R TYPESCRIPT ANGULAR GIT POSTGRESQL MONGODB ASP AI GO KOTLIN SASS VUE DSA GEN AI SCIPY AWS CYBERSECURITY DATA SCIENCE
     ❯   

Bootstrap CSS 表格参考


<table> 类

使用以下类来设置任何表格的样式:

描述 示例
.table 为任何 <table> 添加基本样式(轻量级填充和仅水平分隔符) 试试看
.table-striped 为 <tbody> 内的任何表格行添加斑马线样式(IE8 中不可用) 试试看
.table-bordered 在表格和单元格的四面添加边框 试试看
.table-hover 在 <tbody> 内的表格行上启用悬停状态 试试看
.table-condensed 通过将单元格填充减半使表格更紧凑 试试看
组合所有表格类 试试看

<tr>, <th> 和 <td> 类

使用以下类来设置表格行或单元格的颜色

描述 示例
.active 将悬停颜色(浅灰色)应用于特定行或单元格 试试看
.success 表示成功或积极的操作 试试看
.info 表示中性的信息性更改或操作 试试看
.warning 表示可能需要关注的警告 试试看
.danger 表示危险或潜在的负面操作 试试看

响应式表格

.table-responsive 类创建一个响应式表格。该表格将在小型设备(小于 768 像素)上水平滚动。在大于 768 像素宽度的任何设备上查看时,没有区别

示例

<div class="table-responsive">
  <table class="table">
    ...
  </table>
</div>
自己试试 »

×

Contact Sales

If you want to use W3Schools services as an educational institution, team or enterprise, send us an e-mail:
[email protected]

Report Error

If you want to report an error, or if you want to make a suggestion, send us an e-mail:
[email protected]

W3Schools is optimized for learning and training. Examples might be simplified to improve reading and learning. Tutorials, references, and examples are constantly reviewed to avoid errors, but we cannot warrant full correctness of all content. While using W3Schools, you agree to have read and accepted our terms of use, cookie and privacy policy.

Copyright 1999-2024 by Refsnes Data. All Rights Reserved. W3Schools is Powered by W3.CSS.