# TableCollection Object

> Contains all tables of a Text Control document or part of the document.

- **Product:** TX Text Control .NET Server
- **Section:** Reference
- **Kind:** Object
- **Introduced:** 28.0
- **Path:** TX Text Control .NET Server > Reference > JavaScript API > TableCollection Object
- **794 words**
- **Web URL:** https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/javascript/tablecollection/
- **LLMs URL:** https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/javascript/tablecollection/llms.txt
- **LLMs-Full URL:** https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/javascript/tablecollection/llms-full.txt

---

### Description

Contains all [tables](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/javascript/table/llms-full.txt) of a Text Control document or part of the document.

### Syntax

```javascript
TableCollection
```

### Examples

The following example demonstrates `TableCollection` in a practical document-editing workflow. It contains all tables of a Text Control document or part of the document.

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

TXTextControl.textParts.getMainText(function(mainText) {
    const tables = mainText.tables;
    tables.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
    );
}, onTxError);
```

---

## In This Section

- [Javascript: TableCollection.add Method](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/javascript/tablecollection/add-method/llms-full.txt): Adds a table at the current input position.
- [Javascript: TableCollection.getCanAdd Method](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/javascript/tablecollection/getcanadd-method/llms-full.txt): Gets a value indicating whether a new table can be inserted at the current input position.
- [Javascript: TableCollection.getGridLines Method](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/javascript/tablecollection/getgridlines-method/llms-full.txt): Gets a value indicating whether table's gridlines are shown or not.
- [Javascript: TableCollection.getItem Method](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/javascript/tablecollection/getitem-method/llms-full.txt): Gets the table at the current input position or the first table in the collection with the given id.
- [Javascript: TableCollection.setGridLines Method](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/javascript/tablecollection/setgridlines-method/llms-full.txt): Sets a value indicating wether table grid lines are shown or not.

---

## Nearby

- **Previous:** [Javascript: TableCellFormat.topBorder Property](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/javascript/tablecellformat/topborder-property/llms-full.txt)
- **Next:** [Javascript: TableCollection.add Method](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/javascript/tablecollection/add-method/llms-full.txt)
