Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

277
Views
Add Excel Styles in Javascript excel

I have used javascript to export my json to excel, any idea how to add the styles like this

enter image description here

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

about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!