# Javascript: SectionFormat.getColumns Method

> Gets the number of columns on a page.

- **Product:** DS Server
- **Section:** Reference
- **Kind:** Method
- **Introduced:** 26.0
- **Path:** DS Server > Reference > JavaScript API > Javascript: SectionFormat.getColumns Method
- **319 words**
- **Web URL:** https://docs.textcontrol.com/ds-server/reference/javascript/sectionformat/getcolumns-method/
- **LLMs URL:** https://docs.textcontrol.com/ds-server/reference/javascript/sectionformat/getcolumns-method/llms.txt
- **LLMs-Full URL:** https://docs.textcontrol.com/ds-server/reference/javascript/sectionformat/getcolumns-method/llms-full.txt

---

### Description

Gets the number of columns on a page.

### Syntax

```javascript
<void> SectionFormat.getColumns(<RequestNumberCallback> callback, [<ErrorCallback> errorCallback])
```

### Parameters

| Parameter | Description |
|---|---|
| callback | Receives the number of columns on a page. |
| errorCallback | Optional. Is called when the operation failed with an error. |

### Examples

The following example demonstrates `SectionFormat.getColumns` in a practical document-editing workflow. It gets the number of columns on a page.

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

function inspectColumns(sectionFormat) {
    sectionFormat.getColumns(
        function(result) {
            console.log("get columns result:", result);
        },
        onTxError
    );
}
```

---

## Nearby

- **Previous:** [Javascript: SectionFormat.getColumnLineWidth Method](https://docs.textcontrol.com/ds-server/reference/javascript/sectionformat/getcolumnlinewidth-method/llms-full.txt)
- **Next:** [Javascript: SectionFormat.getColumnWidths Method](https://docs.textcontrol.com/ds-server/reference/javascript/sectionformat/getcolumnwidths-method/llms-full.txt)
