pagedjs icon indicating copy to clipboard operation
pagedjs copied to clipboard

Improvement request for better table breaks

Open eduarevalo opened this issue 2 years ago • 4 comments

When a table produces a break token in a given column, all the following columns are sent to the next page even those that still fit in the current page.

Example, a table like:

| ----------- | ----------- |
| Syntax      | Description |
| ----------- | ----------- |
| Multi-line  | Single cell |
| Cell        |             |
| ----------- | ----------- |

Should breaks:

Page 1                              Page 2
| ----------- | ----------- |       | ----------- | ----------- |
| Syntax      | Description |       | Cell        |             |
| ----------- | ----------- |       | ----------- | ----------- |
| Multi-line  | Single cell |
| ----------- | ----------- |

But produces:

Page 1                              Page 2
| ----------- | ----------- |       | ----------- | ----------- |
| Syntax      | Description |       | Cell        | Single cell |
| ----------- | ----------- |       | ----------- | ----------- |
| Multi-line  |             |
| ----------- | ----------- |

eduarevalo avatar Aug 03 '23 19:08 eduarevalo

@julientaq @fchasen Maybe have you explored this ?

eduarevalo avatar Aug 11 '23 15:08 eduarevalo

@eduarevalo a solution to this that we've used is to wrap each

in a , setting "break-inside:avoid" on the tbody. Ie, From previous versions, break-inside:avoid didn't appear to work on the itself.

Jasonkingsmill avatar Sep 10 '23 21:09 Jasonkingsmill

This is good suggestion. Yes I noticed the same issue in my library https://github.com/tmasabari/AptTecReports

image

tmasabari avatar Sep 22 '23 05:09 tmasabari

Hi there.

Please see https://github.com/pagedjs/pagedjs/pull/171, which I've just submitted for consideration. It includes a large rework of the pagination code that should help with this issue. I'd appreciate your feedback.

Regards,

Nigel

NigelCunningham avatar Oct 29 '23 23:10 NigelCunningham