protobi / js-xlsx

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

can i format all of the cell style in one column? #114

Open yellowjian opened 6 years ago

yellowjian commented 6 years ago

i want ti format all of the cell style in one column, maybe text left or right.

yellowjian commented 6 years ago

@pietersv @pietersv @pietersv please help me~ thanks.

pietersv commented 6 years ago

@yellowjian The way SheetJS currently represents spreadsheets, you'd need to set styles cell by cell. You can define a single object, e.g. var salesColumnStyle = { ...} but that would still generate XML for each cell.

The library is open source so you might create a simple Excel sheet with a column style applied, open it up and see how it's represented internally. That said, if your goal is just to generate styled XLSX workbooks, then a small libraries like github.com/protobi/msexcel-builder might be easier to extend.