Cell merging is a very easy task using TX Text Control. The method MergeCells of the Table object merges all selected table cells in a table.

In order to select the desired table cells, the Select method can be used. Adjacent cells can be merged horizontally, vertically and both:

Horizontal:

Quick tip: Merging cells in tables

Vertical:

Quick tip: Merging cells in tables

Block:

Quick tip: Merging cells in tables

The following code shows how to use the Select method to select a block of cells from row 1 to row 2 and column 2 to column 3:

textControl1.Tables.Add(3, 6, 10);
Table table = textControl1.Tables.GetItem(10);
table.Select(1, 2, 2, 3);
table.MergeCells();
view raw test.cs hosted with ❤ by GitHub