I have used javascript to export my json to excel, any idea how to add the styles like this
This is the code
var table_div = '<table>'
var headers = ['Header 1', 'Header 2', 'Header 3']
headers.forEach((header) => {
table_div += `<td >${header}</td>`
})
table_div += `</tr>`
dataSet.forEach((item) => {
table_div += `<tr><td>${item.transactionDate}</td>`
table_div += `<td>${item.comment}</td>`
table_div += `<td>${(item.debit + item.credit).toFixed(2)}</td></tr>`
})
table_div += '</table>'
console.log(table_div)
var data_type = 'data:application/vnd.ms-excel;';
var table_html = table_div.replace(/ /g, '%20');
var a = document.createElement('a');
a.href = data_type + ', ' + table_html;
a.download = 'myExel.xls';
a.click();
My goal is download the exported file with these styling applied already