Datatables 1.10 + Bootstrap 丢失了蓝白条纹行模式

blue-white striped rows pattern is lost with Datatables 1.10 + Bootstrap

我正在使用 Bootstrap 3 + Datatables 1.09,一切正常。我尝试升级到 Datatables 1.10,但 tables 的蓝白条纹图案不再出现。如果我将 class "table table-striped" 添加到我的 table,条纹图案为灰白色。我怎样才能恢复原来的蓝色条纹图案? 问候, 帕特里克

DataTables 站点上的

Bootstrap 3 example 确实显示了带有 grey/white 模式的 table,此样式在 Bootstrap CSS 文件中定义。如果不查看您的 CSS 文件及其顺序,很难说出为什么升级后样式会丢失。

要覆盖此模式,请在结束 </head> 标记之前添加以下代码,并将 table-striped class 添加到您的 table.

<style type="text/css">
/* BOOTSTRAP 3 TWEAKS */
.table-striped > tbody > tr:nth-of-type(2n+1),
.table-striped > tbody > tr.odd {
    background-color: #D9EDF7;
}
.table-striped > tbody > tr.even {
    background-color: #FFF;
}
</style>

更新:更新了 CSS 以对偶数行着色。