<!-- Do not edit this file. It is automatically generated by API Documenter. -->

[Home](./index.md) &gt; [mr-excel](./mr-excel.md) &gt; [convertTableToExcel](./mr-excel.converttabletoexcel.md)

## convertTableToExcel() function

Converts an HTML table to an Excel file.

**Signature:**

```typescript
export declare function convertTableToExcel(queryForTable?: string, table?: HTMLTableElement, config?: {
    keepStyle?: boolean;
    rowHeightScaleFunction?: RowHeightScaleFunction;
    colWidthScaleFunction?: ColWidthScaleFunction;
}): ExcelTableReturnType;
```

## Parameters

<table><thead><tr><th>

Parameter


</th><th>

Type


</th><th>

Description


</th></tr></thead>
<tbody><tr><td>

queryForTable


</td><td>

string


</td><td>

_(Optional)_ The query selector for the table.


</td></tr>
<tr><td>

table


</td><td>

HTMLTableElement


</td><td>

_(Optional)_ The HTML table element.


</td></tr>
<tr><td>

config


</td><td>

{ keepStyle?: boolean; rowHeightScaleFunction?: RowHeightScaleFunction; colWidthScaleFunction?: ColWidthScaleFunction; }


</td><td>

_(Optional)_ The configuration options.


</td></tr>
</tbody></table>

**Returns:**

ExcelTableReturnType

{<!-- -->ExcelTableReturnType<!-- -->} The generated Excel table.

