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 < classes.length) { return { classes: classes[index / 2] }; } return {}; }
bootstrapTable设置行样式(背景颜色)函数2:调用自定义样式设置指定行的字体颜色
function rowStyle(row, index) { var style = {}; style={css:{'color':'#ed5565'}}; return style; }
相关推荐:《bootstrap教程》
以上就是bootstrap table给行怎么加背景色的详细内容,更多请关注php中文网其它相关文章!
每个人都需要一台速度更快、更稳定的 PC。随着时间的推移,垃圾文件、旧注册表数据和不必要的后台进程会占用资源并降低性能。幸运的是,许多工具可以让 Windows 保持平稳运行。
Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号