Overview of the NewTable and the CurTable objects

Build 1501 on 14/Nov/2017  This topic last edited on: 30/Sep/2015, at 15:15

NewTable and CurTable objects manage a complete table., while TableColumn and TableRow objects manage other attributes (and supersede optionally some table-level settings), and TableCell object manages cell-level attributes.

Use NewTable object to create a new table with specific attributes, similarly to what is achieved with the InsTableDlg command. Use CurTable object to edit the current table, as you would do it with the EditTableMainDlg command.

Table objects have a number of properties, each one corresponding to a table attribute. Each one of these properties can be set - modifying the corresponding attribute - or queried - returning the value of the corresponding attribute. All the properties have always a value. The values that are assigned to attribute properties are validated: attempts to assign invalid values causes run-time errors, e.g. it is not possible to assign to the NRows property a negative value.

Table objects can be 'attached' (associated) with texts. To perform a number of operations - like editing the attributes specified by a table object - it is actually necessary for the object to be associated with the text. Table object created using GetNewTable or GetCurTable is automatically attached to the current text, whereas object created using CreateObject must be explicitly  attached to a text using the AttachObject function.

Creating a NewTable object

Creating a CurTable object

About table and column widths

Which properties you cannot set on the table level?