<link href="bootstrap.min.css" rel="stylesheet"> 导入bootstrap的外部样式表
<thead> <tr> <th>表格标题</th> <th>表格标题</th> <th>表格标题</th> </tr> </thead> 表头
<tbody> <tr class="info"> <th>表格单元格</th> <th>表格单元格</th> <th>表格单元格</th> </tr> </tbody> 表格内容table-striped 斑马线
table-bordered 边框
table-hover 鼠标响应
table-condensed 浓缩布局
table-responsive 在div中,响应式布局
单元格颜色:class="info" 蓝色class="danger" 红色class-="warning" 黄色class="active" 选中class="success" 绿色
<!DOCTYPE html> <html> <head lang="en"> <meta charset="UTF-8"> <title></title> <link href="bootstrap.min.css" rel="stylesheet"> </head> <body> <div class="table-responsive"> <!--<table class="table table-striped table-bordered table-hover table-condensed">--> <table class="table table-bordered"> <thead> <tr> <th>表格标题</th> <th>表格标题</th> <th>表格标题</th> </tr> </thead> <tbody> <tr class="info"> <th>表格单元格</th> <th>表格单元格</th> <th>表格单元格</th> </tr> <tr class="danger"> <th>表格单元格</th> <th>表格单元格</th> <th>表格单元格</th> </tr> <tr class-="warning"> <th>表格单元格</th> <th>表格单元格</th> <th>表格单元格</th> </tr> <tr class="active"> <th>表格单元格</th> <th>表格单元格</th> <th>表格单元格</th> </tr> <tr class="success"> <th>表格单元格</th> <th>表格单元格</th> <th>表格单元格</th> </tr> </tbody> </table> </div> </body> </html>
bootstrap入门【表格】
最新推荐文章于 2023-05-08 17:53:24 发布