question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Unable to fill background color

See original GitHub issue

Why does this code have no effect?It can not fill the background color?Who can help me?

` json.map((v, i) => { if(maxLen<Object.keys(v).length){ maxLen=Object.keys(v).length; } return Object.keys(v).map((k, j) => { //取出键对应的值

        return Object.assign({}, { //拼接输出的sheet
          v: v[k],
          position: (j > 25 ? this.getCharCol(j) : String.fromCharCode(65 + j)) + (i + 1),
           
        })}
      )
    }).reduce((prev, next) =>  prev.concat(next)).forEach(function (v) {
      var cell={ //转换输出json
        v: v.v,
        s:{ 
          fill : {
            fgColor : {
                theme : 8,
                tint : 0.3999755851924192,
                rgb : '08CB26'
            }
          },
          font : {
              color : {
                  rgb : "FFFFFF"
              },
              bold : true
          },
          border : {
              bottom : {
                  style : "thin",
                  color : {
                      theme : 5,
                      tint : "-0.3",
                      rgb: "E8E5E4"
                  }
              }
          }  
        }
      }
      if ( typeof cell.v === 'number')  
           cell.t = 'n';  
        else if ( typeof cell.v === 'boolean')  
            cell.t = 'b';  
        else if (cell.v instanceof Date) {  
            cell.t = 'n';  
            cell.z = XLSX.SSF._table[14];  
            cell.v = datenum(cell.v);  
        } else  
            cell.t = 's';
      tmpdata[v.position] = cell;
      
    })

`

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:11 (1 by maintainers)

github_iconTop GitHub Comments

32reactions
SheetJSDevcommented, May 20, 2018

We offer this in the Pro compendium. Since companies have paid for the features already, it would be unfair to them if we turned around and made it available as open source. We have a longer comment in a gist.

1reaction
JesusFregosocommented, Nov 27, 2017

Sorry my bad im using this fork https://github.com/xSirrioNx/js-xlsx i think is better the should merge to master

Read more comments on GitHub >

github_iconTop Results From Across the Web

Unable to set background color with Absolute and Fixed ...
I'm unable to set background color when i use position to my signin div and bottom div.I tried to remove position but it...
Read more >
Can't change background color - Microsoft Community
Hello,. Strange question... I can't change the background color for certain paragraphs. I've uploaded the document to Word online:.
Read more >
Add a background color to text in Pages for iCloud
If the color is behind the text only (not into the margins): Click the Style button near the top, click the Action pop-up...
Read more >
Can't change background color in Acrobat Pro DC
Are you trying to change the background colour for yourself, ... What makes it a template specifically (rather than just a cover for...
Read more >
How to Fix When Fill Color Doesn't Display Properly in Excel
First, make sure that the cells you're trying to fill are actually selected. If they're not, the fill color won't show up. Next,...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found