axlsx
axlsx copied to clipboard
Auto-height
Axlsx has support for autowidth, but what do you think about auto height?, for columns containing multiple rows of text.
+1
+1
+1
+1
+1
+1
+1
Can't you accomplish this through word wrap?
+1
+1
+1
+1
+1
+1 Is there any workaround for this in the meantime that people have come up with?
You can just use word wrap or you can count the number of lines and multiply that by the +/- the font size
could you do a gist for handling this? or is there a way to query the worksheet for the number of rows given a fontSize and a certrain string of text?
Yeah, so I was using wordwrap but still had rows and words cut off.
Ended up writing a helper to do similar to what you suggest @jurriaan . Checked the cells autowidth value, then taking in to account that, any new lines, and a bit of a buffer for whitespace at the end of each line, assign a new row hight. .... A bit (quite) flakey, but quick, and it will do the trick in the short term.
+1
+1
@hofdesu can you share the helper re: calculating the height?
@hofdesu yes, could you please show your helper?
+1
+1
+1
+1
+1
Hello @randym, how one should approach a PR for this feature? what's to take into account?
+1
+1
+1