Bootstrap Table表頭添加背景色,可以通過theadClasses屬性設置表頭樣式。
設置theadClasses屬性沒設置theadClasses屬性時候,背景色默認是白色
bootstrap背景顏色設置
.bg-primary 主要的
.bg-success 成功
.bg-info 信息
.bg-warning 警告
.bg-danger 危險
顏色效果對應下圖
theadClasses設置背景色」bg-info」
$("#table").bootstrapTable({
toolbar: '#toolbar', //自定義工具按鈕
url: url, //請求後臺的URL(*)
method: 'get', //請求方式(*)
cache: false, //是否使用緩存,默認為true,所以一般情況下需要設置一下這個屬性(*)
theadClasses: "bg-info",
.
})
表格背景色顯示效果
先在頭部設置style樣式
color 字體顏色
background-color 背景色
border-color 邊框顏色
// 作者-上海悠悠 QQ交流群:717225969
// blog地址 https://www.cnblogs.com/yoyoketang/
<head>
<style>
.table-green {
color: #042cff;
background-color: #84f1cd;
border-color: #84f1cd;
}
</style>
</head>
給表頭設置自定義的 table-green 屬性
// 作者-上海悠悠 QQ交流群:717225969
// blog地址 https://www.cnblogs.com/yoyoketang/
$("#table").bootstrapTable({
toolbar: '#toolbar', //自定義工具按鈕
url: url, //請求後臺的URL(*)
method: 'get', //請求方式(*)
cache: false, //是否使用緩存,默認為true,所以一般情況下需要設置一下這個屬性(*)
theadClasses: "table-green",
.
})
顯示效果如下
2021年第 9 期《python接口web自動化+測試開發》課程,10月17號開學!
加量不加價(新增postman, 贈送selenium和python基礎2個課)
本期上課時間:10月17號-1月9號,每周六、周日晚上20:30-22:30
聯繫微信/QQ:283340479