# Javascript: SectionFormat.setColumnWidths Method

> Sets the widths, in twips, of the columns on a page.

- **Product:** TX Text Control .NET Server
- **Section:** Reference
- **Kind:** Method
- **Introduced:** 26.0
- **Path:** TX Text Control .NET Server > Reference > JavaScript API > Javascript: SectionFormat.setColumnWidths Method
- **361 words**
- **Web URL:** https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/javascript/sectionformat/setcolumnwidths-method/
- **LLMs URL:** https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/javascript/sectionformat/setcolumnwidths-method/llms.txt
- **LLMs-Full URL:** https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/javascript/sectionformat/setcolumnwidths-method/llms-full.txt

---

### Description

Sets the widths, in twips, of the columns on a page.

### Syntax

```javascript
<void> SectionFormat.setColumnWidths(<number[]> columnWidths, [<EmptyRequestCallback> callback], [<ErrorCallback> errorCallback])
```

### Parameters

| Parameter | Description |
|---|---|
| columnWidths | The widths, in twips, of the columns on a page. |
| callback | Optional. Is called when the operation completed. |
| errorCallback | Optional. Is called when the operation failed with an error. |

### Examples

The following example demonstrates `SectionFormat.setColumnWidths` in a practical document-editing workflow. It sets the widths, in twips, of the columns on a page.

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

function configureColumnWidths(sectionFormat) {
    sectionFormat.setColumnWidths(
        [],
        function() {
            console.log("set column widths completed.");
        },
        onTxError
    );
}
```

---

## Nearby

- **Previous:** [Javascript: SectionFormat.setColumns Method](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/javascript/sectionformat/setcolumns-method/llms-full.txt)
- **Next:** [Javascript: SectionFormat.setEqualColumnWidth Method](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/javascript/sectionformat/setequalcolumnwidth-method/llms-full.txt)
