# Javascript: TableOfContents.setMaximumStructureLevel Method

> Sets the maximum structure level for this table of contents. The table of contents contains all paragraphs with a structure level less than or equal this value. It must be between 1 and 10.

- **Product:** DS Server
- **Section:** Reference
- **Kind:** Method
- **Introduced:** 29.0
- **Path:** DS Server > Reference > JavaScript API > Javascript: TableOfContents.setMaximumStructureLevel Method
- **420 words**
- **Web URL:** https://docs.textcontrol.com/ds-server/reference/javascript/tableofcontents/setmaximumstructurelevel-method/
- **LLMs URL:** https://docs.textcontrol.com/ds-server/reference/javascript/tableofcontents/setmaximumstructurelevel-method/llms.txt
- **LLMs-Full URL:** https://docs.textcontrol.com/ds-server/reference/javascript/tableofcontents/setmaximumstructurelevel-method/llms-full.txt

---

### Description

Sets the maximum structure level for this table of contents. The table of contents contains all paragraphs with a structure level less than or equal this value. It must be between 1 and 10.

### Syntax

```javascript
<void> TableOfContents.setMaximumStructureLevel(<number> value, [<EmptyRequestCallback> callback], [<ErrorCallback> errorCallback])
```

### Parameters

| Parameter | Description |
|---|---|
| value | The property value. |
| callback | Optional. Is called when the operation completed. |
| errorCallback | Optional. Is called when the operation failed with an error. |

### Examples

The following example demonstrates `TableOfContents.setMaximumStructureLevel` in a practical document-editing workflow. It sets the maximum structure level for this table of contents. The table of contents contains all paragraphs with a structure level less than or equal this value. It must be between 1 and 10.

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

function configureMaximumStructureLevel(tableOfContents) {
    tableOfContents.setMaximumStructureLevel(
        1,
        function() {
            console.log("set maximum structure level completed.");
        },
        onTxError
    );
}
```

---

## Nearby

- **Previous:** [Javascript: TableOfContents.setID Method](https://docs.textcontrol.com/ds-server/reference/javascript/tableofcontents/setid-method/llms-full.txt)
- **Next:** [Javascript: TableOfContents.setMinimumStructureLevel Method](https://docs.textcontrol.com/ds-server/reference/javascript/tableofcontents/setminimumstructurelevel-method/llms-full.txt)
