prawnpdf / prawn-table

Provides support for tables in Prawn
Other
206 stars 101 forks source link

Fresh work on nowrap cells #149

Open andyjeffries opened 2 years ago

andyjeffries commented 2 years ago

Based almost entirely on:

https://github.com/prawnpdf/prawn-table/pull/50

Implements the wrapping, adds no more failures (than the current master fails on 3.0.4 anyway), but adds new tests and documentation.

andyjeffries commented 2 years ago

I took the work on #50, made it not fail any more tests than before, added new tests and docs. All seems "fine", except there's an additional border now, that I don't know how to get rid of!

Any ideas @gettalong ? Thanks.

Screenshot 2022-09-09 at 13 26 14

andyjeffries commented 2 years ago

I've just done another example in there to debug, and if I force the left cell to have a newline, the right cell is effectively only half-height, but doesn't get the weird border mid-cell.

Screenshot 2022-09-09 at 14 54 50

gettalong commented 2 years ago

@andyjeffries I'm not very acquainted with the prawn-table code but will have a look if I find some time.

andyjeffries commented 2 years ago

Thanks anyway @gettalong , I found it though. I was calling cell in the manual which immediately draws it to the page as a standalone object (with its own height, that of the content), then passed it to the table (which drew it at the same height as its neighbouring cell).

This is now ready for review and merging (ignoring the test that failed before this one)

andyjeffries commented 2 years ago

Just added whitespace as an option to nowrap. I found in my app that if I don't use nowrap it can wrap mid-word awkwardly in a table, but if i I use the new nowrap it's too long for the rest of the row to fit nicely. That is not what I intended, so now I've added another option to handle that. The manual should hopefully make it clear.

Screenshot 2022-09-12 at 11 33 24

andyjeffries commented 1 year ago

@gettalong this is ready for review, but the request is blocked (I've been using it in production for six months now). Could you approve/review it?

gettalong commented 1 year ago

@andyjeffries I'm sorry but I currently don't have the time for that.