Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit5bed18b

Browse files
fix: table column style bug and addTable colum type (#2649)
* fix table column style bug and addTable colum type* make TableColumnProperties.style optional
1 parentddab279 commit5bed18b

File tree

3 files changed

+12
-3
lines changed

3 files changed

+12
-3
lines changed

‎index.d.ts‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1832,6 +1832,11 @@ export interface TableColumnProperties {
18321832
* Optional formula for custom functions
18331833
*/
18341834
totalsRowFormula?:string;
1835+
1836+
/**
1837+
* Styles applied to the column
1838+
*/
1839+
style?:Partial<Style>;
18351840
}
18361841

18371842

‎lib/doc/table.js‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -183,7 +183,7 @@ class Table {
183183
constassignStyle=(cell,style)=>{
184184
if(style){
185185
Object.keys(style).forEach(key=>{
186-
cell[key]=style[key];
186+
cell.style[key]=style[key];
187187
});
188188
}
189189
};

‎test/test-table.js‎

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
constExcel=require('../lib/exceljs.nodejs.js');
1+
constExcel=require('../lib/exceljs.nodejs');
22
constHrStopwatch=require('./utils/hr-stopwatch');
33

44
const[,,filename]=process.argv;
@@ -47,14 +47,18 @@ ws.addTable({
4747
totalsRowFunction:'max',
4848
filterButton:true,
4949
totalsRowResult:8,
50+
style:{numFmt:'0.00%'},
5051
},
5152
{
5253
name:'Word',
5354
filterButton:false,
5455
style:{font:{bold:true,name:'Comic Sans MS'}},
5556
},
5657
],
57-
rows:words.map((word,i)=>[newDate(+today+(86400*i)),i,word]),
58+
rows:words.map((word,i)=>{
59+
constadditionalDays=86400*i;
60+
return[newDate(today+additionalDays),i,word];
61+
}),
5862
});
5963

6064
conststopwatch=newHrStopwatch();

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp