DS Server

TableCell Object

Object|Introduced in 28.0

Description

Represents a single cell of a table in a Text Control document.

Syntax

TableCell

Examples

The following example demonstrates TableCell in a practical document-editing workflow. It represents a single cell of a table in a Text Control document.

function onTxError(error) {
    console.error("TX Text Control error:", error.msg);
    error.handled = true;
}

function inspectTableCell(tableCell) {
    tableCell.getText(
        function(result) {
            console.log("get text result:", result);
        },
        onTxError
    );
}

Members

Methods

MethodDescription
getCellFormatGets the formatting attributes of a table cell. The property's value is an object of type TableCellFormat.
getColumnGets the table cell's column number.
getFormulaGets the table cell's formula. For each table cell a formula can be defined which is used to calculate the cell's text. The formula can contain references to other table cells in the same table. When the text of a referenced cell changes, the cell which references it is automatically updated.
getLengthGets the number of characters in the table cell. If the table cell is merged, the property returns -1.
getNameGets the cell's name. Each table cell can have a name, which can be used to store any string data associated with the cell.
getPositionGets, in twips, the horizontal position of the cell.
getRowGets the table cell's row number.
getStartGets the index (one-based) of the first character in the table cell.
getTextGets the cell's text.
getWidthGets, in twips, the width of the cell.
selectSelects the table cell.
setFormulaSets the table cell's formula. For each table cell a formula can be defined which is used to calculate the cell's text. The formula can contain references to other table cells in the same table. When the text of a referenced cell changes, the cell which references it is automatically updated.
setNameSets the cell's name. Each table cell can have a name, which can be used to store any string data associated with the cell.
setPositionSets, in twips, the horizontal position of the cell.
setTextSets the cell's text.
setWidthSets, in twips, the width of the cell.