How to put data from one cell of datatable into few cells after export it in Excel and change layout
How to put data from one cell of datatable into few cells after export it in Excel and change layout
Hello!
First, datatables.net is awsome tool, thank you for this)
Could you help me please with this question:
when exporting excel I need to change layout and put data from one cell into few separate cells in Excel file and change layout a little.
Here is how it export now by default:
https://drive.google.com/file/d/0Bzg6WEBaX15HUlBBZ3dUMWpLaXM/view?usp=sharing
I need it to look like this:
https://drive.google.com/file/d/0Bzg6WEBaX15HeXM5T1pFRDJfakU/view?usp=sharing
Is it possible to do this?
Here is my button code, but it doesn't split to separate cells:
buttons: [
{
extend: 'excelHtml5',
className: 'tableButtonExcel',
title: 'RevenueTable' + moment().format(TIME_STAMP_FORMAT),
text: '<i class="fa fa-file-excel-o"></i>',
titleAttr: 'Download Excel',
header: false,
exportOptions: {
format: {
body: function ( data, row, column, node ) {
var datasplit = data.split('/')
return datasplit[0] + '</t>' +datasplit[1] + '</t>' + datasplit[2];
}
}},
}
],