Skip to content

Commit

Permalink
Merge pull request rusty1s#2 from GarikFF/rowspan-fix
Browse files Browse the repository at this point in the history
Rowspan fix
  • Loading branch information
rusty1s authored Dec 10, 2016
2 parents d8f1044 + a139faf commit 30631d8
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 3 deletions.
2 changes: 1 addition & 1 deletion dist/table2excel.js

Large diffs are not rendered by default.

6 changes: 5 additions & 1 deletion src/helpers/data-to-worksheet.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,11 @@ export default function dataToWorksheet(data, typeHandlers) {
});

// only save actual cells and convert them to XLSX-Cell objects
if (cell) sheet[ref] = cellToObject(cell, typeHandlers);
if (cell) {
sheet[ref] = cellToObject(cell, typeHandlers);
} else {
sheet[ref] = { t: 's', v: '' };
}
});

return sheet;
Expand Down
2 changes: 1 addition & 1 deletion src/helpers/table-to-data.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ export default function tableToData(table) {
cells[rowIndex].length <= range.e.c
) {
// ... fill the cells with empty values
for (let i = range.s.c; i < range.e.c; i++) {
for (let i = range.s.c; i <= range.e.c; i++) {
cells[rowIndex].push(null);
}
}
Expand Down

0 comments on commit 30631d8

Please sign in to comment.