Back to Devexpress

TableCollection Class

aspnetcore-js-devexpress-dot-richedit-28fd8827.md

latest2.2 KB
Original Source

TableCollection Class

A collection of the Table objects.

Declaration

ts
export class TableCollection extends TableBaseCollection<Table>

Inherited Members

count

getByIndex(index)

Methods

create(position, columnCount, rowCount) Method

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

Declaration

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

Parameters

NameTypeDescription
positionnumber

The table position.

| | columnCount | number |

The number of columns in the table.

| | rowCount | number |

The number of rows in the table.

|

Returns

TypeDescription
Table

The newly created table.

|

Remarks

javascript
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

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

Parameters

NameTypeDescription
positionnumberIInterval

A document position or interval.

|

Returns

TypeDescription
Table[]

A list of tables.

|

Remarks

javascript
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();