這篇文章主要為大家展示了“基于Bootstrap table組件如何實現(xiàn)多層表頭”,內(nèi)容簡而易懂,條理清晰,希望能夠幫助大家解決疑惑,下面讓小編帶領(lǐng)大家一起研究并學(xué)習(xí)一下“基于Bootstrap table組件如何實現(xiàn)多層表頭”這篇文章吧。
成都創(chuàng)新互聯(lián)-專業(yè)網(wǎng)站定制、快速模板網(wǎng)站建設(shè)、高性價比龍川網(wǎng)站開發(fā)、企業(yè)建站全套包干低至880元,成熟完善的模板庫,直接使用。一站式龍川網(wǎng)站制作公司更省心,省錢,快速模板網(wǎng)站建設(shè)找我們,業(yè)務(wù)覆蓋龍川地區(qū)。費用合理售后完善,十載實體公司更值得信賴。
0.效果圖
1.實現(xiàn)方法
<html> <head> <title>多層表頭</title> <link href="https://cdn.bootcss.com/bootstrap-table/1.11.1/bootstrap-table.min.css" rel="stylesheet"> <style type="text/css"> .table td, .table th { font-style: normal; font-weight: normal; text-align:center; } .bootstrap-table { width: 100%; } </style> </head> <body> <table data-toggle="table"> <thead> <tr> <th data-colspan="1">妻子</th> <th data-colspan="2">車子</th> <th data-colspan="3">房子</th> <th data-rowspan="2">總價值</th> </tr> <tr> <th>唯一</th> <th>Mini</th> <th>Smart</th> <th>90平</th> <th>149平</th> <th>別墅</th> </tr> </thead> <tbody> <tr> <td>∞</td> <td>30萬</td> <td>20萬</td> <td>60萬</td> <td>100萬</td> <td>看著辦</td> <td>∞∞</td> </tr> </tbody> </table> <script src="https://cdn.bootcss.com/jquery/3.2.1/jquery.js"></script> <script src="https://cdn.bootcss.com/bootstrap-table/1.11.1/bootstrap-table.min.js"></script> </body> </html>
2.具體步驟
第一步,通過CDN引入jquery和bootstrap-table。
<link href="https://cdn.bootcss.com/bootstrap-table/1.11.1/bootstrap-table.min.css" rel="stylesheet"> <script src="https://cdn.bootcss.com/jquery/3.2.1/jquery.js"></script> <script src="https://cdn.bootcss.com/bootstrap-table/1.11.1/bootstrap-table.min.js"></script>
第二步,第一層表頭;
<tr> <th data-colspan="1">妻子</th> <th data-colspan="2">車子</th> <th data-colspan="3">房子</th> <th data-rowspan="2">總價值</th> </tr>
通過data-colspan指定二級表頭橫向有多少個,縱向為1;
通過data-rowspan指定二級表頭縱向有多少個,橫向為1;
第三步,第二層表頭;
<tr> <th>唯一</th> <th>Mini</th> <th>Smart</th> <th>90平</th> <th>149平</th> <th>別墅</th> </tr>
注意data-rowspan=”2”對應(yīng)的第二層表頭就不需要指定了。
第三步,啟用bootstrap-table。
<table data-toggle="table"> </table>
以上是“基于Bootstrap table組件如何實現(xiàn)多層表頭”這篇文章的所有內(nèi)容,感謝各位的閱讀!相信大家都有了一定的了解,希望分享的內(nèi)容對大家有所幫助,如果還想學(xué)習(xí)更多知識,歡迎關(guān)注創(chuàng)新互聯(lián)行業(yè)資訊頻道!
分享名稱:基于Bootstraptable組件如何實現(xiàn)多層表頭
URL地址:http://jinyejixie.com/article0/gpicio.html
成都網(wǎng)站建設(shè)公司_創(chuàng)新互聯(lián),為您提供服務(wù)器托管、自適應(yīng)網(wǎng)站、小程序開發(fā)、網(wǎng)站收錄、App設(shè)計、云服務(wù)器
聲明:本網(wǎng)站發(fā)布的內(nèi)容(圖片、視頻和文字)以用戶投稿、用戶轉(zhuǎn)載內(nèi)容為主,如果涉及侵權(quán)請盡快告知,我們將會在第一時間刪除。文章觀點不代表本網(wǎng)站立場,如需處理請聯(lián)系客服。電話:028-86922220;郵箱:631063699@qq.com。內(nèi)容未經(jīng)允許不得轉(zhuǎn)載,或轉(zhuǎn)載時需注明來源: 創(chuàng)新互聯(lián)