https://github.com/seregpie/xlsx.utils.cells_to_sheet
Converts an array of arrays of cell objects to a worksheet.
https://github.com/seregpie/xlsx.utils.cells_to_sheet
Last synced: about 2 months ago
JSON representation
Converts an array of arrays of cell objects to a worksheet.
- Host: GitHub
- URL: https://github.com/seregpie/xlsx.utils.cells_to_sheet
- Owner: SeregPie
- License: mit
- Created: 2017-09-29T13:49:27.000Z (over 7 years ago)
- Default Branch: main
- Last Pushed: 2021-03-19T15:54:35.000Z (about 4 years ago)
- Last Synced: 2025-03-08T02:34:18.971Z (2 months ago)
- Language: JavaScript
- Homepage:
- Size: 1.95 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# XLSX.utils.cells_to_sheet
`XLSX.utils.cells_to_sheet(data)`
Converts an array of arrays of cell objects to a worksheet.
## setup
### npm
```shell
npm i xlsx.utils.cells_to_sheet
```---
Import inside an ES module.
```javascript
import 'xlsx.utils.cells_to_sheet';
import XLSX from 'xlsx';
```*or*
Import inside a CommonJS module.
```javascript
require('xlsx.utils.cells_to_sheet');
let XLSX = require('xlsx');
```### browser
```html
```
## usage
```javascript
let items = [
['a', 0.543],
['b', 0.164],
['c', 0.774],
];
let ws = XLSX.utils.cells_to_sheet(items.map(([label, value]) => [
{t: 's', v: label},
{t: 'n', v: value, z: '0%'},
]));
```