Coder Social home page Coder Social logo

defaultCellStyle API about workbook HOT 6 CLOSED

knownasilya avatar knownasilya commented on July 22, 2024
defaultCellStyle API

from workbook.

Comments (6)

 avatar commented on July 22, 2024

That's part of the protobi/js-xlsx fork, not the main branch. Styles in general aren't exported with the main branch yet.

The API is the same as for the .s attribute. On testing just now, it seems that Excel is only paying attention to the font.name and font.sz attributes, not fill color.

XLSX.writeFile(workbook, OUTFILE, {defaultCellStyle: { font: { name: "Courier New", sz: 18}}});

For other cells, you might define a constant style and reference that for other cells:

from workbook.

knownasilya avatar knownasilya commented on July 22, 2024

This worked for me:

defaultCellStyle: {
  font: {name: 'Arial', sz: '12'},
  fill: {
    fgColor: { rgb: 'FFFFFFFF' }
  }
}

Are there docs on what styles are available for the s attribute?

from workbook.

 avatar commented on July 22, 2024

Not yet. That's important to add. For now can use the example.js as a reference.

from workbook.

knownasilya avatar knownasilya commented on July 22, 2024

@protobi good enough, for now.

I don't see anything about borders, are those supported yet?

from workbook.

 avatar commented on July 22, 2024

Sorry! Borders aren't in yet. Shouldn't be too difficult to add now there's a framework for it. May get to that this coming week, is that sufficient for your timeline?

from workbook.

knownasilya avatar knownasilya commented on July 22, 2024

That's more then fine! If you need any help let me know.

from workbook.

Related Issues (10)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.