Patrick
Patrick

Reputation: 2709

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

I'm using Bootstrap 3 + Datatables 1.09 and everything is fine. I tried to upgrade to Datatables 1.10 and the blue-white striped pattern of my tables is not appearing anymore. If I add the class "table table-striped" to my table, the striped pattern is grey-white. How can I recover my original blue striped pattern? Regards, Patrick

Upvotes: 1

Views: 1190

Answers (1)

Gyrocode.com
Gyrocode.com

Reputation: 58880

Bootstrap 3 example on the DataTables site indeed shows a table with grey/white pattern, this style is defined in Bootstrap CSS file. It's hard to say why the style the lost after the upgrade without looking at your CSS files and their order.

To override this pattern, add the following code before the closing </head> tag and add table-striped class to your 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>

UPDATE: Updated the CSS to color the even rows as well.

Upvotes: 1

Related Questions