3

Useful Tricks for Working with Tables

 1 year ago
source link: https://www.textcontrol.com/blog/2023/08/04/useful-tricks-for-working-with-tables/
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
neoserver,ios ssh client

Useful Tricks for Working with Tables

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.

Tables

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.

Table Broken?

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.

Tables

About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK