Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sheet API - rows and cells #6

Open
knownasilya opened this issue Mar 6, 2015 · 3 comments
Open

Sheet API - rows and cells #6

knownasilya opened this issue Mar 6, 2015 · 3 comments

Comments

@knownasilya
Copy link
Contributor

Would be nice to have an API like:

wb.createSheet('Abutters', options) // default styles and other options
  .row(options) // default options for row, cells inherit these options unless overwritten
    .cell(value, options) 
    .cell(value, options)
  .row() // 1 empty row
  .rowOffset(2) // 2 empty rows
  .row(value, options) // merged
    .cellOffset(5) // 5 empty cells
    .cell(value)
  .row(options)
    .cells([1, 2, 3]) // 3 cells with values only, work well with default row options
  .finalize();

Or something similar. This could make it open to things like currencyCell(value, format) or other cell types.

@knownasilya knownasilya changed the title columns & rows API rows and cells API Mar 6, 2015
@knownasilya knownasilya changed the title rows and cells API Sheet API - rows and cells Mar 6, 2015
@knownasilya
Copy link
Contributor Author

Could also do:

var options = {
  cellTemplates: {
    warningCell: {
      style: {
        font: {
          bold: true
        },
        fill: {
          fgColor: { rgb: 'FFFF0000' }
        }
      }
    }
  }
};

wb.createSheet('Abutters', options)
  .row()
    .warningCell('Important: Do this!')
  .row()
    .cell('Eat your breakfast!')
  .finalize();

@protobi
Copy link
Collaborator

protobi commented Mar 6, 2015

Agree, that's a great idea.

On Fri, Mar 6, 2015 at 1:56 PM, Ilya Radchenko [email protected]
wrote:

Would be nice to have an API like:

wb.createSheet('Abutters')
.row(options) // default styles for row
.cell(value, options)
.cell(value, options)
.row() // blank row
.row(value, options) // merged
.cell(value)
.finalize();

Or something similar.


Reply to this email directly or view it on GitHub
#6.

Pieter Sheth-Voss PhD

protobi
e: [email protected]
m: 617.645.4524

@knownasilya
Copy link
Contributor Author

I made my own little wrapper for basic table like spreadsheets with multiple sheets and headers:

https://gist.github.com/knownasilya/ad990b7f7bcd125b58f7

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant