# Table Object

> The Table object represents a table in a document.

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

---

### Description

The Table object represents a table in a document.

### Syntax

```javascript
Table
```

### Examples

The following example demonstrates `Table` in a practical document-editing workflow. The Table object represents a table in a 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.getItem(function(table) {
        if (!table) {
            console.warn("No table is available at the current input position.");
            return;
        }
    
        table.getID(
            function(result) {
                console.log("get id result:", result);
            }
        );
    }, onTxError);
}, onTxError);
```

---

## In This Section

- [Javascript: Table.cells Property](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/javascript/table/cells-property/llms-full.txt): The collection of all table cells the table consists of.
- [Javascript: Table.columns Property](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/javascript/table/columns-property/llms-full.txt): Gets a collection of all columns the table consists of.
- [Javascript: Table.getCanMergeCells Method](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/javascript/table/getcanmergecells-method/llms-full.txt): Checks whether table cells can be merged. Table cells can only be merged, if more than one cell in this table is selected.
- [Javascript: Table.getCanSplit Method](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/javascript/table/getcansplit-method/llms-full.txt): Checks whether this table can be split. A table can only be split if it contains the current input position and no further text is selected.
- [Javascript: Table.getCanSplitCells Method](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/javascript/table/getcansplitcells-method/llms-full.txt): Checks whether previously merged table cells in this table can be split. Only selected table cells can be split.
- [Javascript: Table.getDescriptiveText Method](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/javascript/table/getdescriptivetext-method/llms-full.txt): Gets the table's descriptive text. The descriptive text is used by screen readers to describe the table to users with visual impairments. An empty string is returned if no descriptive text is set.
- [Javascript: Table.getID Method](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/javascript/table/getid-method/llms-full.txt): Gets the table's identifier.
- [Javascript: Table.getNestedLevel Method](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/javascript/table/getnestedlevel-method/llms-full.txt): Gets the nested level for the specified table. Top level tables have a level of 1.
- [Javascript: Table.getOuterMostTable Method](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/javascript/table/getoutermosttable-method/llms-full.txt): Gets a table's outermost table. This is a top-level table with a nested level of 1. The property's value is an object of the prototype Table or null if this table is already a top-level table.
- [Javascript: Table.getOuterTable Method](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/javascript/table/getoutertable-method/llms-full.txt): Gets table's outer table.
- [Javascript: Table.mergeCells Method](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/javascript/table/mergecells-method/llms-full.txt): Merges all selected table cells in this table. {@link Table#getCanMergeCells} can be used to determine, if table cells can be merged or not.
- [Javascript: Table.nestedTables Property](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/javascript/table/nestedtables-property/llms-full.txt): Gets a collection of all tables nested in this table.
- [Javascript: Table.rows Property](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/javascript/table/rows-property/llms-full.txt): Gets a collection of all rows the table consists of.
- [Javascript: Table.select Method](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/javascript/table/select-method/llms-full.txt): Selects the complete table.
- [Javascript: Table.selectCells Method](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/javascript/table/selectcells-method/llms-full.txt): Selects the part of the table defined through two table cells.
- [Javascript: Table.setDescriptiveText Method](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/javascript/table/setdescriptivetext-method/llms-full.txt): Sets the table's descriptive text. The descriptive text is used by screen readers to describe the table to users with visual impairments. An empty string or null can be passed to remove the descriptive text.
- [Javascript: Table.setID Method](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/javascript/table/setid-method/llms-full.txt): Sets the table's id.
- [Javascript: Table.split Method](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/javascript/table/split-method/llms-full.txt): Splits a table below or above the current input position. If the table does not contain the current input position it cannot be split. The getCanSplit method can be used to determine if a table can be split or not. If a table is split above the first row a new line is inserted above the table and if a table is split below the last row a new line is inserted below the table. This is useful to insert text above or below a nested table that immediately starts and/or ends at the beginning or the end of the cell in which it is nested.
- [Javascript: Table.splitCells Method](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/javascript/table/splitcells-method/llms-full.txt): Splits all selected table cells in this table. Only previously merged cells can be split. The getCanSplitCells method can be used to determine, if table cells can be split or not.

---

## Nearby

- **Previous:** [Javascript: SubTextPartInfo.start Property](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/javascript/subtextpartinfo/start-property/llms-full.txt)
- **Next:** [Javascript: Table.cells Property](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/javascript/table/cells-property/llms-full.txt)
