xlsx.utils.cells_to_sheet
v18.10.1
Published
Converts an array of arrays of cell objects to a worksheet.
Downloads
12
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
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%'},
]));