To remove striping on Datatables you add:
stripeClasses:[]
But I have the following styling added to change background cell color depending on the value of the cell:
var table = $('#driverTable').DataTable({
paging: false,
scrollX: true,
order: [[2, 'desc']],
drawCallback: function (settings) {
applyConditionalFormatting(this.api());
},
stripeClasses: []
});
$('input.toggle-vis').on('change', function (e) {
e.preventDefault();
var column = table.column($(this).attr('data-column'));
column.visible($(this).prop('checked'));
});
function applyConditionalFormatting(table) {
var higherIsBetter = {
1: true, // Races Count
2: true, // Rating
3: false, // Start Position
};
for (var colIndex = 1; colIndex <= 17; colIndex++) {
// Get all data in this column
var data = table.column(colIndex, { search: 'applied' }).data();
if (values.length > 0) {
var min = Math.min.apply(null, values);
var max = Math.max.apply(null, values);
// For each cell in this column
table.column(colIndex, { search: 'applied' }).nodes().each(function (cell, i) {
}
// Set background color
var color = 'hsl(' + hue + ', 100%, 75%)'; // Adjust lightness as needed
And it adds the striping overtop the custom styling I added.
How do I remove the striping?