
bootstrap table给行怎么加背景色
bootstrap table定义代码:
$table.bootstrapTable({
showExport: true,
height: 540,
rowStyle:rowStyle,//通过自定义函数设置行样式
columns: [
{
field: 'id',
title: '序号',
align: 'center',
sortable: true
}, {
field: 'sid',
title: '学号',
align: 'center'
},
]
});
bootstrapTable设置行样式(背景颜色)函数1:通过调用bootstrap默认的样式来设置指定行的背景颜色
function rowStyle(row, index) {
var classes = ['active', 'success', 'info', 'warning', 'danger'];
if (index % 2 === 0 && index / 2 <p>bootstrapTable设置行样式(背景颜色)函数2:调用自定义样式设置指定行的字体颜色<br></p><div class="aritcle_card flexRow artxards">
<div class="artcardd flexRow">
<a class="aritcle_card_img" rel="nofollow" href="/xiazai/skill4914" title="VPS Bootstrap"><img
src="https://img.php.cn/upload/skill/000/000/081/179025304626966.jpg" alt="VPS Bootstrap" onerror="this.onerror='';this.src='/static/lhimages/moren/morentu.png'" ></a>
<div class="aritcle_card_info flexColumn">
<a rel="nofollow" href="/xiazai/skill4914" title="VPS Bootstrap" class="overflowclass">VPS Bootstrap</a>
<p class="overflowclass">从零启动全新 VPS,完成 OpenClaw 完整部署,包括备份/恢复及恢复后验证。用于 OpenClaw 部署。</p>
</div>
<a rel="nofollow" href="/xiazai/skill4914" title="VPS Bootstrap" class="aritcle_card_btn flexRow flexcenter"><b></b><span>下载</span>
</a>
</div>
</div><pre class="brush:php;toolbar:false">function rowStyle(row, index) {
var style = {};
style={css:{'color':'#ed5565'}};
return style;
}
相关推荐:《bootstrap教程》










