openxlsx icon indicating copy to clipboard operation
openxlsx copied to clipboard

Extend setRowHeights to accept parameter(s) "auto"

Open DavidBreuer opened this issue 6 years ago • 3 comments

Extend setRowHeights to accept parameter(s) "auto" to automatically scale row heights. For long cell entries, the row height is automatically adjusted (and text wrapping enabled) so that all lines are visible.

The use of the "auto" parameter(s) is analogue to the setColWidths function: setRowHeights(wb, sheet, rows = c(1, 2, 8, 4, 6), heights = c(30, "auto", 15, 15, 30))

The computation of the text width currently uses the basic strwidth function but can certainly be improved. For now I introduced a "factor" parameter to adjust the text width for different fonts or font families.

DavidBreuer avatar May 02 '18 13:05 DavidBreuer

@s439 Thanks for the approval! I resolved the conflicts, so the PR should be ready to be merged.

DavidBreuer avatar Mar 02 '20 10:03 DavidBreuer

Thanks for the feature @DavidBreuer ! Hope it will be merged soon

SamuelAllain avatar Apr 27 '22 12:04 SamuelAllain

Thanks for this - I found it because I was searching for exactly this feature. Would be great to see this merged

Tom-K-UKRI avatar May 12 '22 11:05 Tom-K-UKRI