# Javascript: TableCellFormat.setTextType Method

> Sets the table cell's text type.

- **Product:** DS Server
- **Section:** Reference
- **Kind:** Method
- **Introduced:** 28.0
- **Path:** DS Server > Reference > JavaScript API > Javascript: TableCellFormat.setTextType Method
- **353 words**
- **Web URL:** https://docs.textcontrol.com/ds-server/reference/javascript/tablecellformat/settexttype-method/
- **LLMs URL:** https://docs.textcontrol.com/ds-server/reference/javascript/tablecellformat/settexttype-method/llms.txt
- **LLMs-Full URL:** https://docs.textcontrol.com/ds-server/reference/javascript/tablecellformat/settexttype-method/llms-full.txt

---

### Description

Sets the table cell's text type.

### Syntax

```javascript
<void> TableCellFormat.setTextType(<TextType> textType, [<EmptyRequestCallback> callback], [<ErrorCallback> errorCallback])
```

### Parameters

| Parameter | Description |
|---|---|
| textType | The cell's text type. |
| 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.setTextType` in a practical document-editing workflow. It sets the table cell's text type.

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

function configureTextType(tableCellFormat) {
    tableCellFormat.setTextType(
        TXTextControl.TextType.Text,
        function() {
            console.log("set text type completed.");
        },
        onTxError
    );
}
```

---

## Nearby

- **Previous:** [Javascript: TableCellFormat.setNumberFormat Method](https://docs.textcontrol.com/ds-server/reference/javascript/tablecellformat/setnumberformat-method/llms-full.txt)
- **Next:** [Javascript: TableCellFormat.setVerticalAlignment Method](https://docs.textcontrol.com/ds-server/reference/javascript/tablecellformat/setverticalalignment-method/llms-full.txt)
