This repository has been archived by the owner on Jan 2, 2023. It is now read-only.
Support CSS "page-break-before" avoid and always for table rows #36
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This was requested multiple times, e.g. wkhtmltopdf/wkhtmltopdf#2997 and wkhtmltopdf/wkhtmltopdf#3395.
This code adds support for 'avoid' and 'always' options of 'page-break-before' property for table rows.
Always is usually used when you just need to break the table at the particular position.
Avoid is used when your table has some sort of row groups which you wouldn't want to be broken to the next page in the middle of. In that case you can set 'auto' for the first row in a group and 'avoid' for all the others - then the page will only be broken between the groups.
PS: An algorithm is just looking for the previous row we can break before. If there is no such row - we're in trouble, meaning that there's nothing we can do to support 'avoid' property.