rtLib — Notes Rich Text Management Library Documentation of rtLib — Notes Rich Text Management Library Download rtLib — Notes Rich Text Management Library FAQ of rtLib — Notes Rich Text Management Library Purchase rtLib — Notes Rich Text Management Library Feedback about rtLib — Notes Rich Text Management Library

Table manipulation

Merge cells

Start search Mail feedback Back to Description

Cells in table may be merged as necessary using MergeCells (startRow, endrow, startColumn, endcolumn) method of rtTable. Each cell may be contained in only one merged region and row and column numbers provided as arguments refer to original cells that may become invisible if merged.

The table is set "Fit to margin":






This is fixed width column





To merge cells with an existing Merged area it must be fully included in the new one










MergeCells will fail in case:

1) one of columns is marked to be fixed width, i.e. in table set "fit to margin" or "fit to window" it retains constant width. "fixed width" setting is kept even in case the table itself is changed to "fixed width" type, hence before merging hasFixedWidth property of the columns involved must be set to False.

2) the table already contains a merged area and it is only partly included in new merge area.

The invalid combinations will be:

table.MergeCells 1,1,2,3 ' 3rd is fixed width column

table.MergeCells 2,2,1,2 ' attempts to merge partially with another merged cell

Successful merge will be:

table.MergeCells 1,3,1,2

table.MergeCells 2,3,1,2 ' both fully include another merged region

To identify merged areas in a table retrieved from item use isVisible property to find cells that are invisible (part of merged area) and isSpanning property set for the only visible cell of the merged region. Use MergeCells and MergeColumns properties of the spanning rtCell object to determine the size of the are.

Use splitCells method to split merged region. It takes as an argument row and column of any cell in merged region. Following both statements will split the cells merged in table above:

table.splitCells 2,2

table.splitCells 3,2