Javascript: TXTextControl.TableAddPosition Enumeration
Description
Specifies the position where to split the table.
Members
| Member | Description |
|---|---|
| Before | The table is split in front of the row with the current input position. |
| After | The table is split behind the row with the current input position. |
Examples
The following example uses TXTextControl.TableAddPosition.After (the table is split behind the row with the current input position.) in a document-editing workflow.
function onTxError(error) {
console.error("TX Text Control error:", error.msg);
error.handled = true;
}
TXTextControl.textParts.getMainText(function(mainText) {
const tables = mainText.tables;
tables.getItem(function(table) {
if (!table) {
console.warn("No table is available at the current input position.");
return;
}
table.split(
TXTextControl.TableAddPosition.After,
function(result) {
if (result) {
console.log("split is available.");
} else {
console.warn("split is not available in the current document state.");
}
},
onTxError
);
}, onTxError);
}, onTxError);