Skip to content

fix: table column style bug and addTable colum type #2649

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

Merged
merged 2 commits into from
Jan 12, 2024

Conversation

jbuck-lineleap
Copy link
Contributor

Summary

A continuation of #1907 with an added test and updates typings to allow for styles to be set in the column definition of a table

Test plan

In a project that is using exceljs as a dependency, i took the following steps:

  1. Navigated to node_modules/exceljs/lib/doc/table.js
  2. Made the change in the PR here cell[key] = style[key] => cell.style[key] = style[key]
  3. Added a column with the following format to my table { name: 'Column Name', totalsRowFunction: 'sum', style: { numFmt: '0.00%' } }
  4. Regenerated the report and confirmed that the colum was formatted as 0.00%'

Related to source code (for typings update)

https://github.com/exceljs/exceljs/blob/master/lib/doc/table.js#L183-L189

Copy link
Member

@Siemienik Siemienik left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, merge on Merge Fest I / 2024

@Siemienik Siemienik merged commit 5bed18b into exceljs:master Jan 12, 2024
aaron-harvey added a commit to aaron-harvey/exceljs that referenced this pull request Mar 28, 2024
fix: table column style bug and addTable colum type (exceljs#2649)
rafaelcaniello added a commit to FieldControl/exceljs that referenced this pull request Jun 20, 2024
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

Successfully merging this pull request may close these issues.

2 participants