TableCollection Class

A collection of the Table objects.

Declaration

export class TableCollection extends Collection<Table>

Inherited Members

Inheritance

Collection<T>
TableCollection

Methods

create(position, columnCount, rowCount) Method

Creates a new Table object with the specified settings and adds it to the collection.

Declaration

create(
    position: number,
    columnCount: number,
    rowCount: number
): Table

Parameters

Name Type Description
position number

The table position.

columnCount number

The number of columns in the table.

rowCount number

The number of rows in the table.

Returns

Type Description
Table

The newly created table.

Remarks

var columnCount = 5;
var rowCount = 5;
var subDocument = richEdit.selection.activeSubDocument;
var position = richEdit.selection.active;
var table = subDocument.tables.create(position, columnCount, rowCount);

find(position) Method

Returns a list of tables that traverse the specified position or interval.

Declaration

find(
    position: number | IInterval
): Table[]

Parameters

Name Type Description
position number | IInterval

A document position or interval.

Returns

Type Description
Table[]

A list of tables.

Remarks

var subDocument = richEdit.selection.activeSubDocument;
var position = richEdit.selection.active;
var tables = subDocument.tables.find(position);
for(var i = tables.length - 1, table; table = tables[i]; i--)
    table.delete();