Add multiple tables in the same sheet #2815

Closed
opened 2022-10-20 11:26:05 +00:00 by mohannad.hanafi · 1 comment

Hello,
I have two arrays, each one of them represents a table

const firstTable = XLSX.utils.json_to_sheet(data)
const secondTable = XLSX.utils.json_to_sheet(statisticsData)

I want a way to add these two tables in the same sheet.

With an example please.

Hello, I have two arrays, each one of them represents a table ``` const firstTable = XLSX.utils.json_to_sheet(data) const secondTable = XLSX.utils.json_to_sheet(statisticsData) ``` I want a way to add these two tables in the same sheet. With an example please.
Owner

https://docs.sheetjs.com/docs/api/utilities#array-of-objects-input has an example:

/* Use shared header */
const header = [];
const ws = XLSX.utils.json_to_sheet(data, {header});
XLSX.utils.sheet_add_json(ws, statisticsData, {header, origin: -1, skipHeader: true});
https://docs.sheetjs.com/docs/api/utilities#array-of-objects-input has an example: ```js /* Use shared header */ const header = []; const ws = XLSX.utils.json_to_sheet(data, {header}); XLSX.utils.sheet_add_json(ws, statisticsData, {header, origin: -1, skipHeader: true}); ```
Sign in to join this conversation.
No Milestone
No Assignees
2 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: sheetjs/sheetjs#2815
No description provided.