我有如下所示的导出datatable pdfhtml的代码
$('#example3').DataTable( {
dom: 'lBfrtip',
buttons: [
{
extend: 'pdfHtml5',
title: 'Data Cucian Kain Cartiva '+d,
orientation:'portrait',
download: 'open',
orientation:'landscape',
customize: function(doc) {
doc.content.forEach(function(item) {
if (item.table) {
item.table.widths = [40, 40, '*','*','*']
}
})
}
}
]
} );像这样的结果

我希望每列中的数据位于中间,而不是左边。
怎么做?
发布于 2016-03-02 07:26:02
简单地使用
customize: function(doc) {
doc.defaultStyle.alignment = 'center';
...
}想一想,它解释了自己:)您的代码在jsfiddle -> https://jsfiddle.net/ccdn6g2v/中工作
https://stackoverflow.com/questions/35738377
复制相似问题