theadClasses設置Bootstrap Table表頭樣式


通過theadClasses屬性設置表頭樣式。

thead-light設置灰色背景

//bootstrap table初始化數據  itxst.com
$('#table').bootstrapTable({
    columns: columns,
    data: getData(),
    theadClasses: "thead-light",//這里設置表頭樣式
    classes: "table table-bordered table-striped table-sm table-dark", 
    height:400  
}); 

thead-dark設置黑色背景

//bootstrap table初始化數據
$('#table').bootstrapTable({
    columns: columns,
    data: getData(),
    theadClasses: "thead-dark",//這里設置表頭樣式
    classes: "table table-bordered table-striped table-sm table-dark", 
    height:400  
});

自定義一個藍色的表頭樣式

 

<style>
/*定義類名為.thead-blue的樣式*/ 
.table .thead-blue th {
color: #fff;
background-color: #3195f1;
border-color: #0d7adf;
}
</style>
//bootstrap table初始化數據
$('#table').bootstrapTable({
    columns: columns,
    data: getData(),
    theadClasses: "thead-blue",//設置thead-blue為表頭樣式
    classes: "table table-bordered table-striped table-sm table-dark", 
    height:400  
});  
 
        

轉載:http://www.itxst.com/Bootstrap-Table/

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM