Perform PageBreak between two rows in the table component #646
-
Hi. I'm generating a PDF with a table using following structure.
Thanks in advance. |
Beta Was this translation helpful? Give feedback.
Answered by
MarcinZiabek
Sep 21, 2023
Replies: 1 comment 2 replies
-
I've solved it by doing following:
It works but I guess there is a better option than adding a fake cell with a pagebreak for each of the cells in the table. |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
There are a couple of concepts that could be used.
If the table is used purely as a structural element, you may consider splitting the content into separate sections within the
Column
element. This allows to manage page breaking by simply adding thePageBreak
element to the table.If keeping the entire content in the table is crucial, you can still follow your idea of inserting a specialized cell with a page break. Just ensure it covers the entire row (so not to disrupt cell ordering). You have accomplished this by inserting as many cells as there are columns. But a more straightforward approach is to use
table.Cell().ColumnSpan(2).PageBreak()
.