# @soyzr/table-to-excel

> it's a javascript plugin to convert and download html tables or data to a xlsx-file

Latest version **1.2.4** (published 2019-11-07) · ISC license · 0 weekly downloads

## Install

```sh
npm install @soyzr/table-to-excel
pnpm add @soyzr/table-to-excel
yarn add @soyzr/table-to-excel
bun add @soyzr/table-to-excel
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.2.4 |
| Published | 2019-11-07 |
| First published | 2019-10-31 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 16.5 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 1 |
| Author | soyzr |
| Maintainers | soyzr |
| Keywords | table to excel, table, excel, js excel, html to excel, data to excel |

## Links

- npm: https://www.npmjs.com/package/@soyzr/table-to-excel
- Repository: https://github.com/cmcesummer/tableToExcel
- Homepage: https://github.com/cmcesummer/tableToExcel#readme
- Issues: https://github.com/cmcesummer/tableToExcel/issues
- npm.io page: https://npm.io/package/@soyzr/table-to-excel

## Alternatives

- [@lexical/table](https://npm.io/package/@lexical/table.md) — 3.0M weekly downloads
- [mantine-datatable](https://npm.io/package/mantine-datatable.md) — 98.2K weekly downloads
- [react-native-collapsible-tab-view](https://npm.io/package/react-native-collapsible-tab-view.md) — 70.6K weekly downloads
- [@handsontable/vue3](https://npm.io/package/@handsontable/vue3.md) — 16.1K weekly downloads
- [vuewordcloud](https://npm.io/package/vuewordcloud.md) — 7.2K weekly downloads

## Recent versions

- 1.2.4 (latest) — 2019-11-07
- 1.1.4 — 2019-11-05
- 1.1.3 — 2019-11-01
- 1.1.2 — 2019-10-31

## README

# table-to-excel

## API

typescript interface

```ts
type IDataArray = Array<any[]>;

type ICB = (err: any, data?: any) => any;

interface IDataSource {
    title?: IDataArray;
    body: IDataArray;
}

interface ITableProp {
    filename?: string;
    dataSource?: IDataSource;
    table?: string | HTMLElement;
    callback?: ICB;
}
```

## example

### dataSource

```js
const TableToExcel = require("@soyzr/table-to-excel");

new TableToExcel({
    filename: "table_to_excel_list",
    dataSource: {
        title: [["Message", null, null, "Other"], ["Name", "Sex", "Age", "Time"]],
        body: [["ZA", "male", 18, new Date()], ["LS", "male", 22, new Date()]]
    }
});
```

### table

1. HTMLElement

```js
const TableToExcel = require("@soyzr/table-to-excel");

const table = document.querySelector("table");

const btn = document.querySelector("button");

btn.addEventListener(
    "click",
    function() {
        new TableToExcel({
            filename: "table_to_excel_list",
            table
        });
    },
    false
);
```

2. string

```js
const TableToExcel = require("@soyzr/table-to-excel");

const table = `
<table>
    <thead>
        <tr>
            <th>Name</th>
            <th>Sex</th>
            <th>Age</th>
            <th>Time</th>
        </tr>
    </thead>
    <tbody>
        <tr>
            <td>ZS</td>
            <td>male</td>
            <td>18</td>
            <td>2019103 0</td>
        </tr> 
    </tbody>
</table>
`;

new TableToExcel({
    filename: "table_to_excel_list",
    table
});
```

---
_Source: https://npm.io/package/@soyzr/table-to-excel · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
