DS Server

Javascript: TableCellFormat.setVerticalAlignment Method

Method|Introduced in 28.0

Description

Sets the vertical alignment of the text in the table cell.

Syntax

<void> TableCellFormat.setVerticalAlignment(<VerticalAlignment> verticalAlignment, [<EmptyRequestCallback> callback], [<ErrorCallback> errorCallback])

Parameters

ParameterDescription
verticalAlignment

Vertical alignment of the text.

callback

Optional. Is called when the operation completed.

errorCallback

Optional. Is called when the operation failed with an error.

Examples

The following example demonstrates TableCellFormat.setVerticalAlignment in a practical document-editing workflow. It sets the vertical alignment of the text in the table cell.

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

function configureVerticalAlignment(tableCellFormat) {
    tableCellFormat.setVerticalAlignment(
        TXTextControl.VerticalAlignment.Center,
        function() {
            console.log("set vertical alignment completed.");
        },
        onTxError
    );
}