-1

I am creating a CSV file using JavaScript. I was unable to manage text format(like header text should be bold). Please help me if anyone has any idea around my requirement.

1 Answers1

0

As far as I know, it is not possible to include text formats in a CSV file. If you want to include formatting information with the data for display in Excel (or am application compatible to some extent with Excel) an alternative may be to produce an XLSX file instead. There are libraries available to do this in Javascript. See, for example, https://github.com/SheetJS/js-xlsx

EDIT: I have just noticed that the freely available community edition of js-xlsx apparently does not support formatting. An alternative is the following library: https://www.npmjs.com/package/exceljs

Marcus
  • 745
  • 6
  • 17