2

I need to put in bold my excel headers using SheetJS

The problem is easy but I couldnt find the solution. With the next code I do an export from an HTML table to Excel. This export is perfect (no problems with this), but I need to have the headers in bold. I don't know how to do it. I have tryed lot of things but no one was good. Can anyone help me? Here you can see the code that I use to obtain the excel sheet from the html table (it works good), I need some extralines here in order to get the headers in bold font.

 function TableToExcel(tableid)
    {

    var wb = XLSX.utils.table_to_book(document.getElementById('example1'), {sheet:"Sheet JS"});

    var wbout = XLSX.write(wb, {bookType:'xlsx', bookSST:true, type: 'binary'});
    saveAs(new Blob([s2ab(wbout)],{type:"application/octet-stream"}), 'RRHH.xlsx');



    function s2ab(s) {

    var buf = new ArrayBuffer(s.length);
    var view = new Uint8Array(buf);
    for (var i=0; i<s.length; i++) view[i] = s.charCodeAt(i) & 0xFF;
    return buf;
    }
AnselVP
  • 27
  • 2
  • XLSX free version does not support styling, only in pro versiyon. I wonder if there is any library supporting styling... – efirat Jan 07 '21 at 17:46

0 Answers0