We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

Detect Tables in 2 or more pages


How is it possible to detect if a table in Word document is contained in 2 or more pages?
We need to insert a Page Break in every table that extends to the next page. We need to insert it in the last row where the table is split. Can you provide a sample code that allow us to do so?

Thank you,

Hi Jawad,

Thanks for your inquiry. I am working over your query and will get back to you soon.

Best regards,

Hi Jawad,

Thank you for being patient.

You will be able to find out on which page a particular Table is located and number of pages it spans by using LayoutCollector.GetStartPageIndex, LayoutCollector.GetEndPageIndex and LayoutCollector.GetNumPagesSpanned methods. These methods automatically build page layout model of the document and update fields if required.

Secondly, please note that you cannot insert a page break inside a table. If you need to achieve this, you should split table into two separate tables and then insert page break between these tables.

Please let me know if I can be of any further assistance.

Best regards,