Convert Excel range to HTML - SheetJS

321 Views Asked by At

I am trying to generate a HTML table from a specified range of an Excel worksheet, but not the entire sheet using sheetJS

SheetJS has the function, XLSX.utils.sheet_to_html(ws, opts), that will convert the sheet to HTML, and maintains merged cells, etc, which is great, but not sure how to limit the range converted. For example, I have a worksheet with two ranges:

  • A1:C5
  • E6:G10

I want to create a HTML table from the values within the E6:G10, and ignore the A1:C5. The E6 and E7 are merged. Do I need to first move the E6:G10 range to a new worksheet, and then use sheet_to_html() to create the HTML table? If so, what's the best approach, unless there is a built-in method?

0

There are 0 best solutions below