The column heading format is not working in export excel sheet. #3032

Open
opened 2023-11-23 12:04:19 +00:00 by proraheelaslam · 0 comments

Hi,
I am trying to add formation on column heading(background and text color) in excel sheet when click the Export to Excel button. It is not working in exported excel file. The table made in HTML table tags.I tried different ways but these methods are not working.

This script is not working

 // Get header cells
           const headerCells = table.querySelectorAll('th');

          // Set blue background color for header cells
           headerCells.forEach((cell, index) => {
            const cellRef = XLSX.utils.encode_cell({ c: index, r: 0 });
             ws[cellRef].s = { fill: { bgColor: { rgb: 'FF0072C6' } }, font: { color: { rgb: 'FFFFFFFF' } } };
          });

I have made the JS fiddle example please check.
https://jsfiddle.net/3nob5yv8/4/

Thanks

Hi, I am trying to add formation on column heading(background and text color) in excel sheet when click the **Export to Excel** button. It is not working in exported excel file. The table made in HTML table tags.I tried different ways but these methods are not working. This script is not working ``` // Get header cells const headerCells = table.querySelectorAll('th'); // Set blue background color for header cells headerCells.forEach((cell, index) => { const cellRef = XLSX.utils.encode_cell({ c: index, r: 0 }); ws[cellRef].s = { fill: { bgColor: { rgb: 'FF0072C6' } }, font: { color: { rgb: 'FFFFFFFF' } } }; }); ``` I have made the JS fiddle example please check. https://jsfiddle.net/3nob5yv8/4/ Thanks
Sign in to join this conversation.
No Milestone
No Assignees
1 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: sheetjs/sheetjs#3032
No description provided.