i need to merge first row of excel sheet exported using datatables this my JavaScript
{
extend: 'excelHtml5',
footer: true,
text: 'Save as Excel',
pageSize: 'A4',
title:'',
filename:'shop',
messageTop: 'shop',
customize: function (xlsx) {
var sheet = xlsx.xl.worksheets['sheet1.xml'];
$('row:first c', sheet).attr( 's', '2' ); // first row is bold
$('row c[r^="A"]', sheet).attr( 's', '2' );
$('row c[r^="B"]', sheet).attr( 's', '55' );
$('row[r=2] c', sheet).attr( 's', '2' );
var col = $('col', sheet);
$(col[0]).attr('width', 8);
$(col[1]).attr('width', 25);
$(col[2]).attr('width', 8);
$(col[3]).attr('width', 9);
$(col[4]).attr('width', 7);
$(col[5]).attr('width', 6);
$(col[6]).attr('width', 7);
$(col[7]).attr('width', 8);
$(col[8]).attr('width', 8);
$('row* ', sheet).each(function (index) {
if (index > 0) {
$(this).attr('ht', 32);
$(this).attr('customHeight', 1);
}
});
}
now output I got is like this at first row cells are not merged and its left aligned
the output i want is something like this first row where title is center aligned and all cells in the first row is merged