jQuery datatables: how to stop it from adding 'odd' or 'even' to the class name

I added "stripeClasses": [], but it didn't have any effect. I had to remove "table-striped" in the list of classes in the table element used to create this data table. For instance, if you have a list of classes like this:

<table class="display table table-striped table-bordered dt-responsive">

simply delete table-striped.


If you want to remove stripe classes globally, set the default options:

$.extend($.fn.dataTable.ext.classes, {
  sStripeEven: '', sStripeOdd: ''
});

If you want to disable the classes during initialization:

$('#example').dataTable( {
  "stripeClasses": []
} );

If you want to disable them on the table directly via data attributes:

<table data-stripe-classes="[]">
</table>