protobi / js-xlsx

XLSX / XLSM / XLSB (Excel 2007+ Spreadsheet) / ODS parser and writer
http://oss.sheetjs.com/js-xlsx
Other
826 stars 416 forks source link

hide gridlines / select tabs #15

Closed pietersv closed 8 years ago

pietersv commented 8 years ago

A quick hack to hide grid lines is to find the line (e.g. xlsx.js:7823)

  o[o.length] = (writextag('dimension', null, {'ref': ref}));

and immediately after that add this line

  o[o.length] = '<sheetViews><sheetView showGridLines="0" tabSelected="1" workbookViewId="0"/></sheetViews>';

A better solution would be to read wb.Props and set the values conditionally. Better still would be to use the provided methods like writeextag rather than inserting a raw xml string. Saving that for daylight.

pietersv commented 8 years ago

Added two new workbook options showGridLines: <true> and tabSelected: <'1'>. Note the capital L in showGridLines.

Checked into github, npm and bower.