# sheetToHtml

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

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.

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

## Parameters

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| ` ws ` | [` WorkSheet `](</xlsx-format/api-reference/interfaces/worksheet/>) | Yes | The worksheet to convert |
| ` opts ` | [` Sheet2HTMLOpts `](</xlsx-format/api-reference/interfaces/sheet2htmlopts/>) | No | Optional HTML generation options (header, footer, id, editable, sanitizeLinks) |

## Returns

` string `

The HTML string representation of the worksheet
