Skip to content

htmlToSheet

On this page

Parse an HTML string containing a <table> into a WorkSheet.

Handles rowspan/colspan attributes and uses data-t/data-v attributes (when present) for round-trip fidelity. This is a lightweight table parser: it recognizes quoted attributes, table cells, ordinary <br> line breaks, and semicolon-terminated HTML character references without implementing full browser DOM parsing.

htmlToSheet(html: string, opts?: HTML2SheetOpts): WorkSheet

Parameters

NameTypeRequiredDescription
htmlstringYesHTML string containing a table
optsHTML2SheetOptsNo

Returns

WorkSheet

A WorkSheet with the parsed table data