Add showGridlines

This commit is contained in:
Pieter Sheth-Voss 2015-12-04 09:49:11 -05:00
parent 57b6fd4662
commit 03b755b3ae
4 changed files with 17 additions and 1 deletions

@ -488,6 +488,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) {

@ -1,6 +1,6 @@
{
"name": "xlsx-style",
"version": "0.8.6",
"version": "0.8.7",
"author": "sheetjs",
"description": "Excel (XLSB/XLSX/XLSM/XLS/XML) and ODS spreadsheet parser and writer (extended to enable read/write of cell formats with xlsx files)",
"keywords": [ "excel", "xls", "xlsx", "xlsb", "xlsm", "ods", "office", "spreadsheet" ],

@ -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) {