openxlsx icon indicating copy to clipboard operation
openxlsx copied to clipboard

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

Open retodomax opened this issue 1 year ago • 1 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

retodomax avatar May 03 '23 13:05 retodomax

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.

Napoleongl avatar May 06 '23 08:05 Napoleongl

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] avatar May 11 '24 02:05 github-actions[bot]