Is there a way to top align all the cells in excel when using export feature of datatables? I am able to wrap the text in excel as well as I have marked “stripNewlines” as false. It works, however the cells are bottom aligned, so it is very hard for the user to read. Is there a way to top align the cells? Thanks.
Here is my code:
customize: function( xlsx ) {
var sheet = xlsx.xl.worksheets['sheet1.xml'];
$('row c[r^="B"]', sheet).attr( 's', '55' );
$('row c[r^="C"]', sheet).attr( 's', '55' );
$('row c[r^="A"]', sheet).attr( 's', '55' );
$('row c[r^="D"]', sheet).attr( 's', '55' );
$('row c[r^="E"]', sheet).attr( 's', '55' );
$('row c[r^="F"]', sheet).attr( 's', '55' );
$('row:nth-child(2) c', sheet).attr('s', '2');
$('row:nth-child(1) c', sheet).attr( 's', '2' );
$('row c[r^="A1"]', sheet).attr( 's', '51' );
},
exportOptions: {
columns: ':visible',
stripNewlines: false
}
},