$('.dataTables-example').DataTable({
pageLength: 25,
dom: '<"html5buttons"B>lTfgitp',
buttons: [
{ extend: 'copy' },
{ extend: 'csv' },
{ extend: 'excel', title: 'ExampleFile' },
{ extend: 'pdfHtml5', title: 'Product Information', messageTop: 'Hi this is pdf message title options', messageBottom: 'Footer PDF show' },
{
extend: 'print',
customize: function (win) {
$(win.document.body).addClass('white-bg');
$(win.document.body).css('font-size', '10px');
$(win.document.body).find('table')
.addClass('compact')
.css('font-size', 'inherit');
}
}
]
});
我正在以不同格式(如 excel、pdf)从 jQuery 数据表中导出数据。某些单元格在数据表中具有不同的背景颜色。但是这些颜色没有显示在导出的 excel 或 pdf 中。谁能告诉我,如何解决这个问题?