Html DataTables隐藏/显示隐藏列按钮CSS样式

Html DataTables隐藏/显示隐藏列按钮CSS样式,html,css,asp.net,datatables,background-color,Html,Css,Asp.net,Datatables,Background Color,我正在使用 <th class="none"></th> 我在第一列添加了一个自定义类,以根据行中的数据禁用按钮: .not-active { pointer-events: none; cursor: default; } 我根据某些行的内容通过C#设置类 <tr><td class='<%# DisableLink(Eval("InvoiceDate").ToString()) %>'><%# Eval("InvoiceN

我正在使用

<th class="none"></th>
我在第一列添加了一个自定义类,以根据行中的数据禁用按钮:

.not-active { pointer-events: none; cursor: default; }
我根据某些行的内容通过C#设置类

<tr><td class='<%# DisableLink(Eval("InvoiceDate").ToString()) %>'><%# Eval("InvoiceNumber")%></td>
和十几种不同的组合,但似乎无法得到正确的格式

有什么建议吗?谢谢


根据请求添加FSFiddle:

设置背景颜色的CSS规则是

table.dataTable.dtr-inline.collapsed tbody td:first-child:before, 
table.dataTable.dtr-inline.collapsed tbody th:first-child:before {
    ...
    background-color: #31b131;
}
若要在
未激活时覆盖此选项,您可以这样修改它:

table.dataTable.dtr-inline.collapsed tbody td.not-active:first-child:before,
table.dataTable.dtr-inline.collapsed tbody th.not-active:first-child:before
{
    background-color:#dddddd;
}

看一个演示。我已将第一行的td设置为不具有
非活动
类,以确保它仅适用于
非活动

你能发布一个小提琴链接吗?@priyapayavula谢谢!我假设您正在寻找类似于以下解决方案的解决方案。访问了该解决方案的JSFIDLE,但它似乎没有正确运行。话虽如此,我认为类似的方法可以奏效。然而,不知道如何翻译到我的情况。
table.dataTable.dtr-inline.collapsed tbody td:first-child:before, 
table.dataTable.dtr-inline.collapsed tbody th:first-child:before {
    ...
    background-color: #31b131;
}
table.dataTable.dtr-inline.collapsed tbody td.not-active:first-child:before,
table.dataTable.dtr-inline.collapsed tbody th.not-active:first-child:before
{
    background-color:#dddddd;
}