DataTable:如何使某一列加粗并居中?

0 css datatables

我使用了DataTable,我想将某个列加粗并将其放在中心。我怎么做 ?

现在这是我的设置:

  // Setting to Inventory Table 
  $('#inventory_exact').dataTable({

    "lengthMenu": [ 10 ] ,
    "bLengthChange": false,
    "searchHighlight": true,
    "bInfo" : false,
    "bRegex" : false,
    "bSmart" : false,
    "sSearch" :"^\\s*"+'1'+"\\s*$"


  });
Run Code Online (Sandbox Code Playgroud)

这是现在的样子:

在此输入图像描述

dav*_*rad 5

为什么不能使用简单的CSS?假设您希望第三列以粗体显示,并且文本居中对齐:

#inventory_exact td:nth-child(3),
#inventory_exact th:nth-child(3) {
    text-align : center;
    font-weight: bold;
}
Run Code Online (Sandbox Code Playgroud)

jQuery dataTables 1.10.x 演示 -> http://jsfiddle.net/1s1kfzja/