# Javascript: Table.getOuterMostTable Method

> 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.

- **Product:** DS Server
- **Section:** Reference
- **Kind:** Method
- **Introduced:** 28.0
- **Path:** DS Server > Reference > JavaScript API > Javascript: Table.getOuterMostTable Method
- **530 words**
- **Web URL:** https://docs.textcontrol.com/ds-server/reference/javascript/table/getoutermosttable-method/
- **LLMs URL:** https://docs.textcontrol.com/ds-server/reference/javascript/table/getoutermosttable-method/llms.txt
- **LLMs-Full URL:** https://docs.textcontrol.com/ds-server/reference/javascript/table/getoutermosttable-method/llms-full.txt

---

### Description

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.

### Syntax

```javascript
<void> Table.getOuterMostTable(<RequestTableCallback> callback, [<ErrorCallback> errorCallback])
```

### Parameters

| Parameter | Description |
|---|---|
| callback | Receives the outer most table as parameter. |
| errorCallback | Optional. Is called when the operation failed with an error. |

### Examples

The following example demonstrates `Table.getOuterMostTable` in a practical document-editing workflow. It 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
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.getOuterMostTable(
            function(table) {
                if (!table) {
                    console.warn("No table was returned.");
                    return;
                }
                
                console.log("get outer most table result:", table);
            },
            onTxError
        );
    }, onTxError);
}, onTxError);
```

---

## Nearby

- **Previous:** [Javascript: Table.getNestedLevel Method](https://docs.textcontrol.com/ds-server/reference/javascript/table/getnestedlevel-method/llms-full.txt)
- **Next:** [Javascript: Table.getOuterTable Method](https://docs.textcontrol.com/ds-server/reference/javascript/table/getoutertable-method/llms-full.txt)
