Skip to main content

DevExpress v24.2 Update — Your Feedback Matters

Our What's New in v24.2 webpage includes product-specific surveys. Your response to our survey questions will help us measure product satisfaction for features released in this major update and help us refine our plans for our next major release.

Take the survey Not interested

TableCollection Class

A collection of the Table objects.

#Declaration

TypeScript
export class TableCollection extends TableBaseCollection<Table>

#Inherited Members

#Methods

#create(position, columnCount, rowCount) Method

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

#Declaration

TypeScript
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

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