Table header repeat even when no space on page for table data
I’m sure this is a word formatting issue but I can’t find an answer, basically I have a table that gets built with headers, it should repeat the header on a new page and it does fine but, depending on the size of the child region it can move to the next page leaving a heading on the page but no child data, I can cure this by allowing the row to split but as this is a legal document I don’t want that.
I would rather be able to not show the header if there is no room for the child data until the next page.
Attached is an example pdf built that show what I mean see page 12, we have Section 13 : APPEALS PROCEDURE then the end of the page then top of page 13 Section 13 : APPEALS PROCEDURE again and the child section.
I know this is correct as there is not enough room on page 12 but can I hide the heading when this happens?
Many Thanks
Mattv
Hi Matthew,
Thanks for your inquiry. Please note that Aspose.Words mimics the same behaviour as MS Word does. If you convert your document to Pdf by using MS Word, you will get the same output.
It would be great if you please share following detail for investigation purposes.
- Please attach your input Word document.
- Please create a standalone/runnable simple application (for example a Console Application Project) that demonstrates the code (Aspose.Words code) you used to generate your output document.
As soon as you get these pieces of information to us we’ll start our investigation into your issue.
Attached is the original doc plus an output in doc format.
Hi Matthew,
Thanks for sharing the document.
saabmatt:
I know this is correct as there is not enough room on page 12 but can I hide the heading when this happens?
In your case, I suggest you please call Document.UpdateTableLayout method before saving the document to Pdf to solve the shared issue. This method updates widths of cells and tables in the document according to their preferred widths and content. You do not need to call this method if the tables appear correct in the output document.
Please read the following documentation links for your kind reference.
https://docs.aspose.com/words/net/working-with-columns-and-rows/
https://docs.aspose.com/words/net/working-with-columns-and-rows/
The Document.UpdateTableLayout method along with adjusting the bottom margin, may have fixed this.
More testing!
Thanks
Matt
Hi Matthew,
Thanks for your feedback. In your case, Aspose.Words behaviour is correct. Please let us konw if you face any issue while using Aspose.Words.
saabmatt:
The Document.UpdateTableLayout method along with adjusting the bottom margin, may have fixed this.
More testing!
Thanks
Matt
Just to update this, the Document.UpdateTableLayout method didn’t fix this.
BUT I found the fix in the end, I used the Word option
“Keep with next” on the Table header Paragraph.
This has fixed it and stops Word adding the table header row
unless there is room for the next table row on the page. J
Hi Matthew,
Thanks for your feedback.
saabmatt:
This has fixed it and stops Word adding the table header row unless there is room for the next table row on the page
Yes, this will fix the issue which you are facing. It is nice to hear from you that you have soveld your problem. Please feel free to ask if you have any question about Aspose.Words, we will be happy to help you.