Conditional Row Background
Conditional Row Background
mrprice22
Posts: 10Questions: 4Answers: 0
So I'm using the following to set the background row of a table that has the followiing bootstrap classes applied.
class="table table-striped table-bordered table-responsive"
This seems to work only on the even rows. Any ideas why?
createdRow: function(row, data, dataIndex) {
if (data.name.trim() == 'BODYPUMP') {
$(row).css({"background-color":"red"});
$(row).addClass('sub-needed');
}
}
This discussion has been closed.
Answers
Seems to apply the background to odd or even rows in this example:
http://live.datatables.net/vecaside/1/edit
Its using Bootstrap 3 and the table class you specified. Maybe you can update the test to replicate the issue.
Kevin
I've added this to my css and that seems to be the problem.
http://live.datatables.net/vecaside/2/edit
I resolved it by getting rid of the bootstrap table-striped class and using the following.
stripeClasses: [ 'odd-row', 'even-row' ],