# htmlToSheet

Source: /xlsx-format/api-reference/functions/htmltosheet

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.

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

## Parameters

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| ` html ` | ` string ` | Yes | HTML string containing a table |
| ` opts ` | [` HTML2SheetOpts `](</xlsx-format/api-reference/interfaces/html2sheetopts/>) | No |  |

## Returns

[` WorkSheet `](</xlsx-format/api-reference/interfaces/worksheet/>)

A WorkSheet with the parsed table data
