TableCollection Object
Description
Contains all tables of a Text Control document or part of the document.
Syntax
TableCollectionExamples
The following example demonstrates TableCollection in a practical document-editing workflow. It contains all tables of a Text Control document or part of the document.
function onTxError(error) {
console.error("TX Text Control error:", error.msg);
error.handled = true;
}
TXTextControl.textParts.getMainText(function(mainText) {
const tables = mainText.tables;
tables.getCanAdd(
function(result) {
if (result) {
console.log("get can add is available.");
} else {
console.warn("get can add is not available in the current document state.");
}
},
onTxError
);
}, onTxError);Members
Methods
| Method | Description |
|---|---|
| add | Adds a table at the current input position. |
| getCanAdd | Gets a value indicating whether a new table can be inserted at the current input position. |
| getGridLines | Gets a value indicating whether table's gridlines are shown or not. |
| getItem | Gets the table at the current input position or the first table in the collection with the given id. |
| getItem | Gets the first table in the collection with the given id. (Inherited from TableBaseCollection.) |
| removeAtInputPosition | Removes the table at the current input position. (Inherited from TableBaseCollection.) |
| removeById | Removes the first table with the passed id. (Inherited from TableBaseCollection.) |
| setGridLines | Sets a value indicating wether table grid lines are shown or not. |