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

[pull] master from exceljs:master #31

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1832,6 +1832,11 @@ export interface TableColumnProperties {
* Optional formula for custom functions
*/
totalsRowFormula?: string;

/**
* Styles applied to the column
*/
style?: Partial<Style>;
}


Expand Down
2 changes: 1 addition & 1 deletion lib/doc/table.js
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@ class Table {
const assignStyle = (cell, style) => {
if (style) {
Object.keys(style).forEach(key => {
cell[key] = style[key];
cell.style[key] = style[key];
});
}
};
Expand Down
8 changes: 6 additions & 2 deletions test/test-table.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
const Excel = require('../lib/exceljs.nodejs.js');
const Excel = require('../lib/exceljs.nodejs');
const HrStopwatch = require('./utils/hr-stopwatch');

const [, , filename] = process.argv;
Expand Down Expand Up @@ -47,14 +47,18 @@ ws.addTable({
totalsRowFunction: 'max',
filterButton: true,
totalsRowResult: 8,
style: {numFmt: '0.00%'},
},
{
name: 'Word',
filterButton: false,
style: {font: {bold: true, name: 'Comic Sans MS'}},
},
],
rows: words.map((word, i) => [new Date(+today + (86400 * i)), i, word]),
rows: words.map((word, i) => {
const additionalDays = 86400 * i;
return [new Date(today + additionalDays), i, word];
}),
});

const stopwatch = new HrStopwatch();
Expand Down
Loading