export excel;can i set column width? thanks!!!
export excel;can i set column width? thanks!!!

{
extend: 'excelHtml5',
text: '导出EXCEL',
title: tableData.printTitle,
//exportOptions: {
// columns: tableData.printColumnsData
//},
//customize: function (xlsx) {
// var sheet = xlsx.xl.worksheets['sheet1.xml'];
// //$('col ', sheet).attr('s', '25');
// $('col c[c*="1"]', sheet).attr('s', '9');
//}
exportOptions: { //选项参见:https://datatables.net/reference/api/buttons.exportData()
columns: tableData.printColumnsData,
format: { // format有三个子标签,header,body和foot
body: function (data, row, column, node) { //操作需要导出excel的数据格式
return data.toString()+' ';
}
},
}
},
Edited by Colin - Syntax highlighting. Details on how to highlight code using markdown can be found in this guide.
This discussion has been closed.
Answers
This thread should help, it's asking the same thing.
Cheers,
Colin