DataTable:如何使某列加粗居中?
DataTable : How to make a certain column bold and center ?
我用的是DataTable,想把某列加粗放在中间。我怎么做 ?
这是我现在的设置:
// Setting to Inventory Table
$('#inventory_exact').dataTable({
"lengthMenu": [ 10 ] ,
"bLengthChange": false,
"searchHighlight": true,
"bInfo" : false,
"bRegex" : false,
"bSmart" : false,
"sSearch" :"^\s*"+'1'+"\s*$"
});
这是现在的样子:
为什么不能使用简单的 CSS?假设您希望第三列为粗体且文本居中对齐:
#inventory_exact td:nth-child(3),
#inventory_exact th:nth-child(3) {
text-align : center;
font-weight: bold;
}
jQuery 数据表 1.10.x 演示 -> http://jsfiddle.net/1s1kfzja/
我用的是DataTable,想把某列加粗放在中间。我怎么做 ?
这是我现在的设置:
// Setting to Inventory Table
$('#inventory_exact').dataTable({
"lengthMenu": [ 10 ] ,
"bLengthChange": false,
"searchHighlight": true,
"bInfo" : false,
"bRegex" : false,
"bSmart" : false,
"sSearch" :"^\s*"+'1'+"\s*$"
});
这是现在的样子:
为什么不能使用简单的 CSS?假设您希望第三列为粗体且文本居中对齐:
#inventory_exact td:nth-child(3),
#inventory_exact th:nth-child(3) {
text-align : center;
font-weight: bold;
}
jQuery 数据表 1.10.x 演示 -> http://jsfiddle.net/1s1kfzja/