I would like to create a prawn table where cell text is wrapped by words and not letters. I am already using shrink_to_fit, but it seems that prawn is wrapping based on letters. I would ideally want it to wrap on words alone (single_line is not an option since there can be 2-3 words per cell).
Anyone knows how to do that ?
Maybe your table contains words that are too long for a single table cell? As far as I know, table cells in Prawn tables use bounding boxes which should wrap the text automatically. The following example works fine for me:
If nothing works, you could try building your own table with multiple text_box calls instead of using the built-in Prawn table method, this is of course a bit cumbersome.
text_boxdraws the requested text into a box. The:overflowparameter controls the behavior when the amount of text exceeds the available space, available options are:truncate,:shrink_to_fit, or:expand.