diff --git a/lib/msexcel-builder.js b/lib/msexcel-builder.js index 71773e8..248f086 100644 --- a/lib/msexcel-builder.js +++ b/lib/msexcel-builder.js @@ -641,7 +641,7 @@ Style = (function() { } } fills = ss.ele('fills', { - count: this.mfills.length + count: this.mfills.length + 1 }); _ref2 = this.mfills; for (_j = 0, _len2 = _ref2.length; _j < _len2; _j++) { @@ -652,8 +652,9 @@ Style = (function() { }); if (o.fgColor !== '-') { es.ele('fgColor', { - theme: '8', - tint: '0.79998168889431442' + // theme: '8', + // tint: '0.79998168889431442' + rgb: o.fgColor }); } if (o.bgColor !== '-') { @@ -661,6 +662,8 @@ Style = (function() { indexed: o.bgColor }); } + /*I don't know what it's about, but it's always like this in real excel files*/ + if (_j==0) fills.ele('fill').ele('patternFill', { patternType: 'gray125' }); } bders = ss.ele('borders', { count: this.mbders.length @@ -726,7 +729,8 @@ Style = (function() { e = cs.ele('xf', { numFmtId: '0', fontId: o.font_id - 1, - fillId: o.fill_id - 1, + /*offset caused by one more 'fill' element*/ + fillId: o.fill_id - 1 + (o.fill_id - 1 == 0 ? 0 : 1), borderId: o.bder_id - 1, xfId: '0' });