# Javascript: TableColumnCollection.getItem Method

> Gets the table column with the specified index or the column at the current input position.

- **Product:** DS Server
- **Section:** Reference
- **Kind:** Method
- **Introduced:** 28.0
- **Path:** DS Server > Reference > JavaScript API > Javascript: TableColumnCollection.getItem Method
- **446 words**
- **Web URL:** https://docs.textcontrol.com/ds-server/reference/javascript/tablecolumncollection/getitem-method/
- **LLMs URL:** https://docs.textcontrol.com/ds-server/reference/javascript/tablecolumncollection/getitem-method/llms.txt
- **LLMs-Full URL:** https://docs.textcontrol.com/ds-server/reference/javascript/tablecolumncollection/getitem-method/llms-full.txt

---

### Description

Gets the table column with the specified index or the column at the current input position.

### Syntax

```javascript
<void> TableColumnCollection.getItem(<RequestTableColumnCallback> callback, [<ErrorCallback> errorCallback], [<number> column])
```

### Parameters

| Parameter | Description |
|---|---|
| callback | Receives the table column at the given index. |
| errorCallback | Optional. Is called when the operation failed with an error. |
| column | Optional. Specifies the column number. It must be between 1 and the value returned through the collection's Count property. |

### Examples

The following example demonstrates `TableColumnCollection.getItem` in a practical document-editing workflow. It gets the table column with the specified index or the column at the current input position.

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

function inspectItem(tableColumns) {
    tableColumns.getItem(
        function(column) {
            if (!column) {
                console.warn("No table column was returned.");
                return;
            }
            
            console.log("get item result:", column);
        },
        onTxError,
        3
    );
}
```

---

## Nearby

- **Previous:** [Javascript: TableColumnCollection.getCanRemove Method](https://docs.textcontrol.com/ds-server/reference/javascript/tablecolumncollection/getcanremove-method/llms-full.txt)
- **Next:** [Javascript: TableColumnCollection.remove Method](https://docs.textcontrol.com/ds-server/reference/javascript/tablecolumncollection/remove-method/llms-full.txt)
