# Javascript: TXTextControl.getCanTableFormat Method

> Informs whether the currently selected text can be formatted with table formatting attributes.

- **Product:** DS Server
- **Section:** Reference
- **Kind:** Method
- **Introduced:** 28.0
- **Path:** DS Server > Reference > JavaScript API > Javascript: TXTextControl.getCanTableFormat Method
- **373 words**
- **Web URL:** https://docs.textcontrol.com/ds-server/reference/javascript/txtextcontrol/getcantableformat-method/
- **LLMs URL:** https://docs.textcontrol.com/ds-server/reference/javascript/txtextcontrol/getcantableformat-method/llms.txt
- **LLMs-Full URL:** https://docs.textcontrol.com/ds-server/reference/javascript/txtextcontrol/getcantableformat-method/llms-full.txt

---

### Description

Informs whether the currently selected text can be formatted with table formatting attributes.

### Syntax

```javascript
<void> TXTextControl.getCanTableFormat(<RequestBooleanCallback> callback, [<ErrorCallback> errorCallback])
```

### Parameters

| Parameter | Description |
|---|---|
| callback | The callback function that receives the requested value. |
| errorCallback | Optional. Is called when the operation failed with an error. |

### Examples

The following example demonstrates `TXTextControl.getCanTableFormat` in a practical document-editing workflow. Informs whether the currently selected text can be formatted with table formatting attributes.

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

TXTextControl.getCanTableFormat(
    function(result) {
        if (result) {
            console.log("get can table format is available.");
        } else {
            console.warn("get can table format is not available in the current document state.");
        }
    },
    onTxError
);
```

---

## Nearby

- **Previous:** [Javascript: TXTextControl.getCanStyleFormat Method](https://docs.textcontrol.com/ds-server/reference/javascript/txtextcontrol/getcanstyleformat-method/llms-full.txt)
- **Next:** [Javascript: TXTextControl.getCanUndo Method](https://docs.textcontrol.com/ds-server/reference/javascript/txtextcontrol/getcanundo-method/llms-full.txt)
