An instance of the Table class represents a table in a Text Control document. It can be obtained from the document's table collection.

Syntax

public class Table
Public Class Table

Examples

The following example shows how to split a table.

textControl1.ResetContents();
int myTableId = 10;

textControl1.Tables.Add(10, 3, myTableId);
TXTextControl.Table myTable = textControl1.Tables.GetItem(myTableId);
textControl1.InputPosition =
  new TXTextControl.InputPosition(myTable.Cells.GetItem(3, 1).Start);

if (myTable.CanSplit)
  myTable.Split(TXTextControl.TableAddPosition.After);

// Correct the table IDs after splitting the original table.
foreach (TXTextControl.Table myCurrentTable in textControl1.Tables)
  myCurrentTable.ID = myTableId++;
TextControl1.ResetContents()
Dim MyTableId As Integer = 10

TextControl1.Tables.Add(10, 3, MyTableId)
Dim MyTable As TXTextControl.Table = TextControl1.Tables.GetItem(MyTableId)
TextControl1.InputPosition = _
  New TXTextControl.InputPosition(MyTable.Cells.GetItem(3, 1).Start)

If MyTable.CanSplit Then
  MyTable.Split(TXTextControl.TableAddPosition.After)
End If

' Correct the table IDs after splitting the original table.
For Each MyCurrentTable As TXTextControl.Table In TextControl1.Tables
  MyCurrentTable.ID = MyTableId
  MyTableId = MyTableId + 1
Next

Methods

Method Description
MergeCells Merges all selected table cells in this table.
Select Selects the table or a part of the table.
Split Splits a table below or above the current input position.
SplitCells Splits all selected table cells in this table.

Properties

Property Description
CanMergeCells Checks whether table cells can be merged.
CanSplit Checks whether this table can be split.
CanSplitCells Checks whether previously merged table cells in this table can be split.
Cells Gets a collection of all table cells the table consists of.
Columns Gets a collection of all columns the table consists of.
ID Gets or sets the table's identifier.
NestedLevel Gets the nested level for the specified table.
NestedTables Gets a collection of all tables nested in this table.
OuterMostTable Gets a table's outermost table.
OuterTable Gets a table's outer table.
Rows Gets a collection of all rows the table consists of.

Further Reading

Learn more about the TXTextControl.Table Class in the Text Control Blog: