TableCell Object
Description
Represents a single cell of a table in a Text Control document.
Syntax
TableCellExamples
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
| Method | Description |
|---|---|
| getCellFormat | Gets the formatting attributes of a table cell. The property's value is an object of type TableCellFormat. |
| getColumn | Gets the table cell's column number. |
| getFormula | Gets 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. |
| getLength | Gets the number of characters in the table cell. If the table cell is merged, the property returns -1. |
| getName | Gets the cell's name. Each table cell can have a name, which can be used to store any string data associated with the cell. |
| getPosition | Gets, in twips, the horizontal position of the cell. |
| getRow | Gets the table cell's row number. |
| getStart | Gets the index (one-based) of the first character in the table cell. |
| getText | Gets the cell's text. |
| getWidth | Gets, in twips, the width of the cell. |
| select | Selects the table cell. |
| setFormula | Sets 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. |
| setName | Sets the cell's name. Each table cell can have a name, which can be used to store any string data associated with the cell. |
| setPosition | Sets, in twips, the horizontal position of the cell. |
| setText | Sets the cell's text. |
| setWidth | Sets, in twips, the width of the cell. |