# TableColumnCollection Object

> Contains all columns of a table in a Text Control document

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

---

### Description

Contains all [columns](https://docs.textcontrol.com/ds-server/reference/javascript/tablecolumn/llms-full.txt) of a table in a Text Control document

### Syntax

```javascript
TableColumnCollection
```

### Examples

The following example demonstrates `TableColumnCollection` in a practical document-editing workflow. It contains all columns of a table in a Text Control document.

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

function inspectTableColumnCollection(tableColumns) {
    tableColumns.getCanAdd(
        function(result) {
            if (result) {
                console.log("get can add is available.");
            } else {
                console.warn("get can add is not available in the current document state.");
            }
        },
        onTxError
    );
}
```

---

## In This Section

- [Javascript: TableColumnCollection.add Method](https://docs.textcontrol.com/ds-server/reference/javascript/tablecolumncollection/add-method/llms-full.txt): Adds a new table column at the current text input position.
- [Javascript: TableColumnCollection.getCanAdd Method](https://docs.textcontrol.com/ds-server/reference/javascript/tablecolumncollection/getcanadd-method/llms-full.txt): Gets a value indicating whether a new column can be inserted at the current input position.
- [Javascript: TableColumnCollection.getCanRemove Method](https://docs.textcontrol.com/ds-server/reference/javascript/tablecolumncollection/getcanremove-method/llms-full.txt): Gets a value indicating whether the selected columns can be removed. Columns can be removed, if either the current text input position is in a column, or if a part of a table is selected.
- [Javascript: TableColumnCollection.getItem Method](https://docs.textcontrol.com/ds-server/reference/javascript/tablecolumncollection/getitem-method/llms-full.txt): Gets the table column with the specified index or the column at the current input position.
- [Javascript: TableColumnCollection.remove Method](https://docs.textcontrol.com/ds-server/reference/javascript/tablecolumncollection/remove-method/llms-full.txt): Removes the table column at the current text input position or all selected columns when a text selection exists.

---

## Nearby

- **Previous:** [Javascript: TableColumn.setWidth Method](https://docs.textcontrol.com/ds-server/reference/javascript/tablecolumn/setwidth-method/llms-full.txt)
- **Next:** [Javascript: TableColumnCollection.add Method](https://docs.textcontrol.com/ds-server/reference/javascript/tablecolumncollection/add-method/llms-full.txt)
