ycphs / openxlsx

openxlsx - a fast way to read and write complex xslx files
https://ycphs.github.io/openxlsx/
Other
220 stars 74 forks source link

colWidths = "auto" should also consider the space taken by the filter button #425

Closed retodomax closed 3 months ago

retodomax commented 1 year ago

Describe the bug colWidths = "auto" adjusts the columns widths but does not take the into account the space taken by the filter button

To Reproduce

df <- data.frame(columnTitle1 = 1:4,
                 columnTitle2 = c("a", "b", "c", "d"))
openxlsx::write.xlsx(x = df, file = "test1.xlsx", asTable = TRUE,
                     colWidths = "auto", withFilter = TRUE)

Open the excel file shows the problem:

image

Expected behavior If argument withFilter = TRUE then there should be some extra space for the filter button

Napoleongl commented 1 year ago

This would definitely be a welcome addition as today you have to count chars and add some space manually and hope there isn’t an excess of m’s or i’s in some of the names.

github-actions[bot] commented 3 months ago

This issue is stale because it has been open 365 days with no activity. Remove stale label or comment or this will be closed in 7 days.

github-actions[bot] commented 3 months ago

This issue was closed because it has been stalled for 7 days with no activity.