TX Text Control .NET Server

Javascript: TXTextControl.TableAddPosition Enumeration

Enumeration|Introduced in 28.0

Description

Specifies the position where to split the table.

Members

MemberDescription
BeforeThe table is split in front of the row with the current input position.
AfterThe 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);

Further Reading