# Javascript: TableCellFormat.setVerticalAlignment Method

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

- **Product:** TX Text Control .NET Server
- **Section:** Reference
- **Kind:** Method
- **Introduced:** 28.0
- **Path:** TX Text Control .NET Server > Reference > JavaScript API > Javascript: TableCellFormat.setVerticalAlignment Method
- **377 words**
- **Web URL:** https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/javascript/tablecellformat/setverticalalignment-method/
- **LLMs URL:** https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/javascript/tablecellformat/setverticalalignment-method/llms.txt
- **LLMs-Full URL:** https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/javascript/tablecellformat/setverticalalignment-method/llms-full.txt

---

### Description

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

### Syntax

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

### Parameters

| Parameter | Description |
|---|---|
| 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.

```javascript
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
    );
}
```

---

## Nearby

- **Previous:** [Javascript: TableCellFormat.setTextType Method](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/javascript/tablecellformat/settexttype-method/llms-full.txt)
- **Next:** [Javascript: TableCellFormat.topBorder Property](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/javascript/tablecellformat/topborder-property/llms-full.txt)
