DS Server

Javascript: Table.cells Property

Property|Introduced in 28.0

Description

The collection of all table cells the table consists of.

Syntax

<TableCellCollection> Table.cells

Examples

The following example enumerates every cell in the current table and reports its non-empty text.

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

TXTextControl.textParts.getMainText(function(mainText) {
    mainText.tables.getItem(function(table) {
        if (!table) {
            console.warn("Place the input position in a table.");
            return;
        }

        table.cells.forEach(function(cell) {
            cell.getText(function(text) {
                if (text.trim().length > 0) {
                    console.log("Cell text:", text);
                }
            }, onTxError);
        }, onTxError);
    }, onTxError);
}, onTxError);

Limitations

Read Only.