mirror of
https://github.com/jmcnamara/libxlsxwriter.git
synced 2026-05-15 14:15:54 -06:00
[GH-ISSUE #118] Question: Column Auto-Fit #98
Labels
No labels
awaiting user feedback
bug
cmake
cmake
docs
feature request
in progress
long term
medium term
medium term
pull-request
question
question
ready to close
short term
under investigation
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference: github-starred/libxlsxwriter#98
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @petricf on GitHub (Aug 11, 2017).
Original GitHub issue: https://github.com/jmcnamara/libxlsxwriter/issues/118
Originally assigned to: @jmcnamara on GitHub.
I've read in the FAQ that this is not available here. But a hint for a workaround was given:
I don't know how evaluate the data width on strings or numbers i intend to write. How to map it to a column width for use (for example) in function worksheet_set_column ?
Is there some sample code available ?
@jmcnamara commented on GitHub (Aug 12, 2017):
From the docs for worksheet_set_column():
What this means in practice is that in the default font the column width is approximately equal to the length of the string (unless the string is iiiiiiii or WWWWWWWW). To be sure you could multiply the strlen() by 1.1 or 1.2. You could build up a map of character widths to column widths for each letter and number but that probably isn't worth the effort unless you really need precision.