Код: Выделить всё
$(this).attr('background-color', '#66FF33');
// and also
$(this).css('background', '#66FF33');
< /code>
Хотя он не сработал.var table = $('#OperationDataTable').DataTable({
"stripeClasses": ['odd-row', 'even-row'],
"lengthMenu": [10, 25, 50, 100, 150],
"pageLength": 50,
"aaSorting": [],
responsive: true,
fixedHeader: false,
dom: 'lfBrtip',
buttons: [{
// 'excel'
extend: 'excelHtml5',
customize: function(xlsx) {
var sheet = xlsx.xl.worksheets['sheet1.xml'];
$('row:first c', sheet).attr('s', '42');
$('row c[r^="D"]', sheet).each(function() {
if ($('is t', this).text() == "Negative NFE") {
$(this).attr('s', '20');
//$(this).attr( 'background-color', '#66FF33' );
} else if ($('is t', this).text() == "Online Done") {
} else {
$(this).attr('s', '34');
}
});
}
}]
});
Подробнее здесь: https://stackoverflow.com/questions/544 ... cel-export