6.5.2 条纹表格
为指定class="table"
的表格增加一个.table-striped
样式即可实现Bootstrap
的条纹表格。
程序示例
例如如下代码:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54
| <!DOCTYPE html> <html>
<head> <meta name="author" content="Yeeku.H.Lee(CrazyIt.org)" /> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <meta name="viewport" content="width=device-width, initial-scale=1"> <title> 条纹状表格 </title> <link rel="stylesheet" href="../bootstrap/css/bootstrap.min.css"> <link rel="stylesheet" href="../bootstrap/css/bootstrap-theme.min.css"> </head>
<body> <div class="container"> <table class="table table-striped"> <caption> <b>疯狂Java体系图书</b> </caption> <thead> <tr> <th>书名</th> <th>作者</th> <th>价格</th> </tr> </thead> <tbody> <tr> <td>疯狂Java讲义</td> <td>李刚</td> <td>109</td> </tr> <tr> <td>疯狂HTML 5/CSS 3/JavaScript讲义</td> <td>李刚</td> <td>79</td> </tr> <tr> <td>疯狂前端开发讲义</td> <td>李刚</td> <td>79</td> </tr> </tbody> <tfoot> <tr> <td colspan="3" style="text-align:right">现总计:3本图书</td> </tr> </tfoot> </table> </div> <script type="text/javascript" src="../jquery-3.1.1.js"></script> <script type="text/javascript" src="../bootstrap/js/bootstrap.min.js"></script> </body>
</html>
|
原文链接: 6.5.2 条纹表格