# Javascript: TableCellBorder.setWidth Method

> Sets the cell's width in twips.

- **Product:** DS Server
- **Section:** Reference
- **Kind:** Method
- **Introduced:** 28.0
- **Path:** DS Server > Reference > JavaScript API > Javascript: TableCellBorder.setWidth Method
- **352 words**
- **Web URL:** https://docs.textcontrol.com/ds-server/reference/javascript/tablecellborder/setwidth-method/
- **LLMs URL:** https://docs.textcontrol.com/ds-server/reference/javascript/tablecellborder/setwidth-method/llms.txt
- **LLMs-Full URL:** https://docs.textcontrol.com/ds-server/reference/javascript/tablecellborder/setwidth-method/llms-full.txt

---

### Description

Sets the cell's width in twips.

### Syntax

```javascript
<void> TableCellBorder.setWidth(<number> width, [<EmptyRequestCallback> callback], [<ErrorCallback> errorCallback])
```

### Parameters

| Parameter | Description |
|---|---|
| width | The cell's width in twips. |
| callback | Optional. Is called when the operation completed. |
| errorCallback | Optional. Is called when the operation failed with an error. |

### Examples

The following example demonstrates `TableCellBorder.setWidth` in a practical document-editing workflow. It sets the cell's width in twips.

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

function configureWidth(tableCellBorder) {
    tableCellBorder.setWidth(
        1440,
        function() {
            console.log("set width completed.");
        },
        onTxError
    );
}
```

---

## Nearby

- **Previous:** [Javascript: TableCellBorder.setTextDistance Method](https://docs.textcontrol.com/ds-server/reference/javascript/tablecellborder/settextdistance-method/llms-full.txt)
- **Next:** [TableCellCollection Object](https://docs.textcontrol.com/ds-server/reference/javascript/tablecellcollection/llms-full.txt)
