# DimensionCollection Class

> DimensionCollection class in the TX Sheet Control JavaScript API for the browser, with 3 properties and 5 methods and a JavaScript example.

- **Product:** TX Sheet Control
- **Section:** Documentation
- **Kind:** Class
- **Path:** TX Sheet Control > API Reference > JavaScript API > Browser Editor > DimensionCollection Class
- **937 words**
- **Web URL:** https://docs.textcontrol.com/tx-sheet-control/reference/javascript-api/browser/dimensioncollection/
- **LLMs URL:** https://docs.textcontrol.com/tx-sheet-control/reference/javascript-api/browser/dimensioncollection/llms.txt
- **LLMs-Full URL:** https://docs.textcontrol.com/tx-sheet-control/reference/javascript-api/browser/dimensioncollection/llms-full.txt

---

Public class for DimensionCollection.

Package: `@txtextcontrol/tx-sheet-control`. Version: **2.0.0**.

ES module import: `import { DimensionCollection } from '@txtextcontrol/tx-sheet-control';`.

### Constructor

```javascript
new DimensionCollection(sheet, axis)
```

| Parameter | Type | Optional | Description |
|---|---|---|---|
| `sheet` | `Worksheet` | No | Value matching sheet's declared type and the owning object's validation rules. |
| `axis` | `"row" \| "column"` | No | Value matching axis's declared type and the owning object's validation rules. |

Returns: `DimensionCollection`.

### Members

#### Properties

| Property | Description |
|---|---|
| [axis](https://docs.textcontrol.com/tx-sheet-control/reference/javascript-api/browser/dimensioncollection/axis-property/llms-full.txt) | The axis value of DimensionCollection. |
| [count](https://docs.textcontrol.com/tx-sheet-control/reference/javascript-api/browser/dimensioncollection/count-property/llms-full.txt) | The count value of DimensionCollection. |
| [sheet](https://docs.textcontrol.com/tx-sheet-control/reference/javascript-api/browser/dimensioncollection/sheet-property/llms-full.txt) | The sheet value of DimensionCollection. |

#### Methods

| Method | Description |
|---|---|
| [at](https://docs.textcontrol.com/tx-sheet-control/reference/javascript-api/browser/dimensioncollection/at-method/llms-full.txt) | Use a zero-based index. |
| [get](https://docs.textcontrol.com/tx-sheet-control/reference/javascript-api/browser/dimensioncollection/get-method/llms-full.txt) | Use visible labels: one-based rows or column letters. |
| [insert](https://docs.textcontrol.com/tx-sheet-control/reference/javascript-api/browser/dimensioncollection/insert-method/llms-full.txt) | Insert before a zero-based index. |
| [remove](https://docs.textcontrol.com/tx-sheet-control/reference/javascript-api/browser/dimensioncollection/remove-method/llms-full.txt) | Delete at a zero-based index. |
| [setHidden](https://docs.textcontrol.com/tx-sheet-control/reference/javascript-api/browser/dimensioncollection/sethidden-method/llms-full.txt) | Hides or reveals consecutive dimensions in one undoable edit; worksheet protection applies. |

### Examples

Use a fresh workbook. Create and format the sample data, apply this API and retain the returned document or result in your application. In the browser pass editor.workbook; in Node.js pass the server control.

```javascript
function createDimensionCollectionReport(book) {
    const sheet = book.sheets.at(0);
    sheet.cell('A1').setText('October invoice');
    sheet.cell('A1').format({
        fontFamily: 'Liberation Sans',
        fontSize: 16,
        bold: true,
        textColor: '#ffffff',
        fillColor: '#163b63',
    });

    sheet.columns.at(0).setWidth({ pixels: 240 });
    sheet.range('B8:B9').setValues([[120], [80]]);
    sheet.cell('B10').setFormula('=SUM(B8:B9)');
    sheet.range('B8:B10').format({ numberFormatCode: '#,##0.00', fontSize: 11 });
    sheet.rows.at(0).setHeight({ points: 28 });
    return sheet;
}
```

### See Also

- [JavaScript Browser Editor API](https://docs.textcontrol.com/tx-sheet-control/reference/javascript-api/browser/llms-full.txt)
- [Workbooks and Worksheets](https://docs.textcontrol.com/tx-sheet-control/spreadsheets/workbooks/llms-full.txt)

---

## In This Section

- [DimensionCollection.at Method](https://docs.textcontrol.com/tx-sheet-control/reference/javascript-api/browser/dimensioncollection/at-method/llms-full.txt): DimensionCollection.at method in the TX Sheet Control JavaScript API for the browser: Use a zero-based index. Includes the syntax and a JavaScript example.
- [DimensionCollection.axis Property](https://docs.textcontrol.com/tx-sheet-control/reference/javascript-api/browser/dimensioncollection/axis-property/llms-full.txt): DimensionCollection.axis property in the TX Sheet Control JavaScript API for the browser, with its type "row" | "column" and a JavaScript example.
- [DimensionCollection.count Property](https://docs.textcontrol.com/tx-sheet-control/reference/javascript-api/browser/dimensioncollection/count-property/llms-full.txt): DimensionCollection.count property in the TX Sheet Control JavaScript API for the browser, with its type number and a JavaScript example.
- [DimensionCollection.get Method](https://docs.textcontrol.com/tx-sheet-control/reference/javascript-api/browser/dimensioncollection/get-method/llms-full.txt): DimensionCollection.get method in the TX Sheet Control JavaScript API for the browser: Use visible labels: one-based rows or column letters.
- [DimensionCollection.insert Method](https://docs.textcontrol.com/tx-sheet-control/reference/javascript-api/browser/dimensioncollection/insert-method/llms-full.txt): DimensionCollection.insert method in the TX Sheet Control JavaScript API for the browser: Insert before a zero-based index.
- [DimensionCollection.remove Method](https://docs.textcontrol.com/tx-sheet-control/reference/javascript-api/browser/dimensioncollection/remove-method/llms-full.txt): DimensionCollection.remove method in the TX Sheet Control JavaScript API for the browser, with the return type DimensionCollection and a JavaScript example.
- [DimensionCollection.setHidden Method](https://docs.textcontrol.com/tx-sheet-control/reference/javascript-api/browser/dimensioncollection/sethidden-method/llms-full.txt): DimensionCollection.setHidden method in the TX Sheet Control JavaScript API for the browser: Hides or reveals consecutive dimensions in one undoable edit.
- [DimensionCollection.sheet Property](https://docs.textcontrol.com/tx-sheet-control/reference/javascript-api/browser/dimensioncollection/sheet-property/llms-full.txt): DimensionCollection.sheet property in the TX Sheet Control JavaScript API for the browser, with its type Worksheet and a JavaScript example.

---

## Nearby

- **Previous:** [Dimension.size Property](https://docs.textcontrol.com/tx-sheet-control/reference/javascript-api/browser/dimension/size-property/llms-full.txt)
- **Next:** [DimensionCollection.at Method](https://docs.textcontrol.com/tx-sheet-control/reference/javascript-api/browser/dimensioncollection/at-method/llms-full.txt)
