xlsx.utils.cells_to_sheet

18.10.1 • Public • Published

XLSX.utils.cells_to_sheet

XLSX.utils.cells_to_sheet(data)

Converts an array of arrays of cell objects to a worksheet.

setup

npm

npm i xlsx.utils.cells_to_sheet

ES module

import 'xlsx.utils.cells_to_sheet';
import XLSX from 'xlsx';

Node

require('xlsx.utils.cells_to_sheet');
let XLSX = require('xlsx');

browser

<script src="https://unpkg.com/xlsx"></script>
<script src="https://unpkg.com/xlsx.utils.cells_to_sheet"></script>

usage

let items = [
  {key: 'a', value: 0.543},
  {key: 'b', value: 0.164},
  {key: 'c', value: 0.774},
];
let ws = XLSX.utils.cells_to_sheet(items.map(item => [
  {t: 's', v: item.key},
  {t: 'n', v: item.value, z: '0%'},
]));

Readme

Keywords

Package Sidebar

Install

npm i xlsx.utils.cells_to_sheet

Weekly Downloads

4

Version

18.10.1

License

MIT

Unpacked Size

3.02 kB

Total Files

4

Last publish

Collaborators

  • seregpie