When you are working with complex and long tables, it can be useful to know if a table is broken up across multiple pages. These code snippets will help you with various table related tasks.
Consider a table with a large number of rows that has been inserted into a TextControl.
Although TextControl provides sophisticated features such as table header repetition, sometimes you may want to add specific text to rows at the beginning of a new page. In order to do this, you need to know whether or not a table is broken across multiple pages.
The following method compares the start index and end index of the table with the index positions of the pages.
When called, it returns true if the table has broken access pages. Otherwise, it returns false.
Get All First Rows
The next method returns the first row after a given row on the next page. This is also done by comparing the line start values with the page indexes.
The following code uses the method FindFirstTableRowOnNextPage to loop through all of the first rows on each page in order to highlight them.
In the following screenshot, you can see the highlighted rows on each new page. This is where the table breaks across pages.