Bootstrap基本樣式學(xué)習(xí)筆記之表格(2)
Bootstrap實現(xiàn)了大量基本樣式,包括表格、表單、按鈕、圖片等?;镜氖褂梅椒ㄊ峭ㄟ^添加特定的class來實現(xiàn)。
Bootstrap 提供了一個清晰的創(chuàng)建表格的布局。
0x01 表格樣式
(1)基本樣式:不帶邊框和分割線:
<!DOCTYPE html> <html lang="zh-cn"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1"> <link href="../../css/bootstrap.min.css" rel="stylesheet"> <script src="http://cdn.bootcss.com/jquery/1.11.1/jquery.min.js"></script> <script src="../../js/bootstrap.min.js"></script> <title>表格</title> </head> <body> <div class="container"> <table class="table"> <tr> <td>序號</td> <td>姓名</td> <td>年齡</td> </tr> <tr> <td>1</td> <td>kikay</td> <td>20</td> </tr> <tr> <td>2</td> <td>Tom</td> <td>18</td> </tr> <tr> <td>1</td> <td>小花</td> <td>21</td> </tr> </table> </div> </body> </html>
(2)樣式:table-bordered:為表格帶上邊框:<table class="table table-bordered table-striped">
(3)樣式:table-striped:為表格帶上斑馬線:<table class="table table-striped">
(4)樣式:.table-hover:為鼠標(biāo)懸浮在表格行上指定不同顏色:<table class="table table-hover">
(5)樣式:.table-condensed:使表格更加緊湊:<table class="table table-condensed">
0x02 狀態(tài)標(biāo)識
還可以為表格中行或者單元格添加狀態(tài)樣式,比如:
<!DOCTYPE html> <html lang="zh-cn"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1"> <link href="../../css/bootstrap.min.css" rel="stylesheet"> <script src="http://cdn.bootcss.com/jquery/1.11.1/jquery.min.js"></script> <script src="../../js/bootstrap.min.js"></script> <title>帶上邊框</title> </head> <body> <div class="container"> <table class="table table-bordered table-striped table-hover table-condensed"> <tr class="alert-danger"> <td class=>序號</td> <td>姓名</td> <td>年齡</td> </tr> <tr class="success"> <td>1</td> <td>kikay</td> <td>20</td> </tr> <tr class="alert-warning"> <td>2</td> <td>Tom</td> <td>18</td> </tr> <tr> <td>1</td> <td>小花</td> <td>21</td> </tr> </table> </div> </body> </html>
如果大家還想深入學(xué)習(xí),可以點擊這里進(jìn)行學(xué)習(xí),再為大家附3個精彩的專題:
以上就是本文的全部內(nèi)容,希望對大家的學(xué)習(xí)有所幫助,也希望大家多多支持腳本之家。
- JS表格組件神器bootstrap table詳解(基礎(chǔ)版)
- Angular.js與Bootstrap相結(jié)合實現(xiàn)表格分頁代碼
- JS組件Bootstrap Table表格行拖拽效果實現(xiàn)代碼
- BootStrap和jQuery相結(jié)合實現(xiàn)可編輯表格
- JS組件Bootstrap Table表格多行拖拽效果實現(xiàn)代碼
- 基于Bootstrap使用jQuery實現(xiàn)簡單可編輯表格
- BootStrap table表格插件自適應(yīng)固定表頭(超好用)
- JS組件系列之Bootstrap table表格組件神器【終結(jié)篇】
- 值得分享的輕量級Bootstrap Table表格插件
- 基于Bootstrap3表格插件和分頁插件實例詳解
相關(guān)文章
JavaScript生成的動態(tài)下雨背景效果實現(xiàn)方法
這篇文章主要介紹了JavaScript生成的動態(tài)下雨背景效果實現(xiàn)方法,通過自定義函數(shù)實現(xiàn)動態(tài)背景效果,具有一定參考借鑒價值,需要的朋友可以參考下2015-02-02
javascript 操作文件 實現(xiàn)方法小結(jié)
可以通過瀏覽器在訪問者的硬盤上創(chuàng)建文件 JavaScript操作文件系統(tǒng)創(chuàng)建快捷方式2009-07-07
詳解如何讓InstantClick兼容MathJax、百度統(tǒng)計等
本篇文章主要介紹了如何讓InstantClick兼容MathJax、百度統(tǒng)計等,小編覺得挺不錯的,現(xiàn)在分享給大家,也給大家做個參考。一起跟隨小編過來看看吧2017-09-09
解決webpack無法通過IP地址訪問localhost的問題
下面小編就為大家分享一篇解決webpack無法通過IP地址訪問localhost的問題,具有很好的參考價值,希望對大家有所幫助。一起跟隨小編過來看看吧2018-02-02
詳解JavaScript Promise和Async/Await
這篇文章主要介紹了JavaScript Promise和Async/Await,對異步編程感興趣的同學(xué),可以參考下2021-04-04
javascript實現(xiàn)一個網(wǎng)頁加載進(jìn)度loading
本篇文章主要介紹了javascript實現(xiàn)一個頁面加載進(jìn)度loading的具體步驟以及示例代碼,具有一定的參考價值,下面跟著小編一起來看下吧2017-01-01

