forked from sheetjs/sheetjs
Add showGridLines as option
This commit is contained in:
parent
0d1281cc94
commit
8b1add6659
@ -478,6 +478,8 @@ The exported `write` and `writeFile` functions accept an options argument:
|
||||
| cellDates | false | Store dates as type `d` (default is `n`) |
|
||||
| bookSST | false | Generate Shared String Table ** |
|
||||
| bookType | 'xlsx' | Type of Workbook ("xlsx" or "xlsm" or "xlsb") |
|
||||
| showGridLines | true | Show gridlines on all pages |
|
||||
| tabSelected | '1' | Initial tab selected |
|
||||
|
||||
- `bookSST` is slower and more memory intensive, but has better compatibility
|
||||
with older versions of iOS Numbers
|
||||
|
@ -296,6 +296,13 @@ function write_ws_xml(idx, opts, wb) {
|
||||
var ref = ws['!ref']; if(ref === undefined) ref = 'A1';
|
||||
o[o.length] = (writextag('dimension', null, {'ref': ref}));
|
||||
|
||||
var sheetView = writextag('sheetView', null, {
|
||||
showGridLines: opts.showGridLines == false ? '0' : '1',
|
||||
tabSelected: opts.tabSelected === undefined ? '1' : opts.tabSelected,
|
||||
workbookViewId: opts.workbookViewId === undefined ? '0' : opts.workbookViewId
|
||||
});
|
||||
o[o.length] = writextag('sheetViews', sheetView);
|
||||
|
||||
if(ws['!cols'] !== undefined && ws['!cols'].length > 0) o[o.length] = (write_ws_xml_cols(ws, ws['!cols']));
|
||||
o[sidx = o.length] = '<sheetData/>';
|
||||
if(ws['!ref'] !== undefined) {
|
||||
|
7
xlsx.js
7
xlsx.js
@ -7821,6 +7821,13 @@ function write_ws_xml(idx, opts, wb) {
|
||||
var ref = ws['!ref']; if(ref === undefined) ref = 'A1';
|
||||
o[o.length] = (writextag('dimension', null, {'ref': ref}));
|
||||
|
||||
var sheetView = writextag('sheetView', null, {
|
||||
showGridLines: opts.showGridLines == false ? '0' : '1',
|
||||
tabSelected: opts.tabSelected === undefined ? '1' : opts.tabSelected,
|
||||
workbookViewId: opts.workbookViewId === undefined ? '0' : opts.workbookViewId
|
||||
});
|
||||
o[o.length] = writextag('sheetViews', sheetView);
|
||||
|
||||
if(ws['!cols'] !== undefined && ws['!cols'].length > 0) o[o.length] = (write_ws_xml_cols(ws, ws['!cols']));
|
||||
o[sidx = o.length] = '<sheetData/>';
|
||||
if(ws['!ref'] !== undefined) {
|
||||
|
Loading…
Reference in New Issue
Block a user