aspnetcore-js-devexpress-dot-richedit-247d9528.md
A collection of the TableCell objects.
export class TableCellCollection extends TableBaseCollection<TableCell>
An object of this class can be accessed by the cells property.
Inserts a cell to the right or left of the specified cell.
insert(
index: number,
toRight?: boolean
): TableCell
| Name | Type | Description |
|---|---|---|
| index | number |
The index of the cell relative to which to insert a cell.
| | toRight | boolean |
true to insert a cell to the right of the specified cell; false to insert a cell to the left of the specified cell.
|
| Type | Description |
|---|---|
| TableCell |
The newly inserted table cell.
|
Note
The newly inserted cell copies appearance settings from the cell whose index you passed as the index parameter.
The following code snippet inserts a new cell to the right of the first table cell:
const subDocument = richEdit.selection.activeSubDocument;
const table = subDocument.tables.getByIndex(0);
table.rows.getByIndex(0).cells.insert(0, true);
Removes a cell with the specified index from the row.
remove(
index: number
): void
| Name | Type | Description |
|---|---|---|
| index | number |
A cell index in the collection.
|
Note
Once you remove all cells from a row, the table removes the row from the row collection.
The following code snippet removes the last cell in the first row:
const subDocument = richEdit.selection.activeSubDocument;
const table = subDocument.tables.getByIndex(0);
const firstRow = table.rows.getByIndex(0);
firstRow.cells.remove(firstRow.cells.count-1);