ycphs/openxlsx

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

Closed this issue · 3 comments

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

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.

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.

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