Skip to content

fix issue #204 sets default column width #1160

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 1 commit into from
Mar 31, 2020

Conversation

Alanscut
Copy link
Member

Changes

@@ -5,6 +5,8 @@ const _ = require('../utils/under-dash');
const Enums = require('./enums');
const colCache = require('../utils/col-cache');

const DEFAULT_COLUMN_WIDTH = 9;
Copy link
Member

Choose a reason for hiding this comment

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

I'm really happy to read your pull requests, good job. I had some issues with width before, so I feel twice satisfaction with your changes 👍
but I'm not sure, that it's the correct way to set a const value,
I think that should be property for worksheet and/or workbook, with a possibility to change it by a user.

May I'm wrong, so please clear me this and tell what are you thinking? 😄

Copy link
Member

@Siemienik Siemienik Mar 22, 2020

Choose a reason for hiding this comment

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

Even if I wrote a comment, I think these PR fix some issues anyway, so I approve it to merge 👍

Copy link
Member Author

Choose a reason for hiding this comment

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

@Siemienik First of all, thank you very much for your approval, this will become my motivation. I really like exceljs, it is very helpful for my work, so I am happy to contribute a little bit of my own power to this software.

  • When the user does not set the column width, I will set a default value for the column.
// single column setting
 sheet.getColumn(3).width = 10;
  • Users can globally set the column width of the entire worksheet
worksheet.properties.defaultColWidth= 47;

@alubbe
Copy link
Member

alubbe commented Mar 29, 2020

@Siemienik should we merge this?

@Siemienik
Copy link
Member

I confirm that it works ok with xlsx-renderer

@Siemienik Siemienik merged commit 46adde7 into exceljs:master Mar 31, 2020
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.

3 participants