You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
There is a serializable attribute on worksheet columns called best_fit which tells excel whether to automatically resize a column. This is apparently set to "true" when the column width is manually set via width=. This would seem to be opposite the expected behavior, especially when considering the attribute documentation on best_fit. I checked back through the commit history and this is not a regression; this bug seems to have been there since the original column code was written.
Hi @zerowaitstate. Let me know if I get it right: the best_fit attribute does not have an instant visual effect, but it defines how the cell should handle when you edit it later and provide a long(er) number.
By default, Excel has "best fit" as true on every cell, you can try it out with an empty sheet. I think the original code meant to keep this behaviour for caxlsx generated cells with pre-calculated widths. It looks like the comments are describing how Excel uses this flag, not how caxlsx is trying to set it.
I can see your point on why do you want to turn this off, so I'd suggest adding a global config to caxlsx to auto-enable best fit or not (default should be the current behaviour). We're doing something similar with No autowidth config.
There is a serializable attribute on worksheet columns called best_fit which tells excel whether to automatically resize a column. This is apparently set to "true" when the column width is manually set via width=. This would seem to be opposite the expected behavior, especially when considering the attribute documentation on best_fit. I checked back through the commit history and this is not a regression; this bug seems to have been there since the original column code was written.
caxlsx/lib/axlsx/workbook/worksheet/col.rb
Line 117 in 6556c62
Before doing a PR I wanted to ask if I am possibly misunderstanding what this attribute does.
The text was updated successfully, but these errors were encountered: