Skip to content

sheetToHtml

On this page

Convert a worksheet to an HTML table string.

Generates a full HTML document (or fragment) containing a <table> with one <tr> per row. Supports merged cells, hyperlinks, editable mode, and data attributes for round-tripping.

sheetToHtml(ws: WorkSheet, opts?: Sheet2HTMLOpts): string

Parameters

NameTypeRequiredDescription
wsWorkSheetYesThe worksheet to convert
optsSheet2HTMLOptsNoOptional HTML generation options (header, footer, id, editable, sanitizeLinks)

Returns

string

The HTML string representation of the worksheet