# Dimension Class

> Dimension class in the TX Sheet Control TypeScript API for the browser, with 5 properties and 4 methods and a TypeScript example.

- **Product:** TX Sheet Control
- **Section:** Documentation
- **Kind:** Class
- **Path:** TX Sheet Control > API Reference > TypeScript API > Browser Editor > Dimension Class
- **984 words**
- **Web URL:** https://docs.textcontrol.com/tx-sheet-control/reference/typescript-api/browser/dimension/
- **LLMs URL:** https://docs.textcontrol.com/tx-sheet-control/reference/typescript-api/browser/dimension/llms.txt
- **LLMs-Full URL:** https://docs.textcontrol.com/tx-sheet-control/reference/typescript-api/browser/dimension/llms-full.txt

---

Public class for Dimension.

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

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

### Constructor

```typescript
new Dimension(sheet: Worksheet, axis: "row" | "column", index: number): Dimension
```

| 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. |
| `index` | `number` | No | Zero-based collection or data-row index. |

Returns: `Dimension`.

### Members

#### Properties

| Property | Description |
|---|---|
| [axis](https://docs.textcontrol.com/tx-sheet-control/reference/typescript-api/browser/dimension/axis-property/llms-full.txt) | The axis value of Dimension. |
| [hidden](https://docs.textcontrol.com/tx-sheet-control/reference/typescript-api/browser/dimension/hidden-property/llms-full.txt) | Whether this dimension is explicitly hidden (independent of AutoFilter). |
| [index](https://docs.textcontrol.com/tx-sheet-control/reference/typescript-api/browser/dimension/index-property/llms-full.txt) | The index value of Dimension. |
| [sheet](https://docs.textcontrol.com/tx-sheet-control/reference/typescript-api/browser/dimension/sheet-property/llms-full.txt) | The sheet value of Dimension. |
| [size](https://docs.textcontrol.com/tx-sheet-control/reference/typescript-api/browser/dimension/size-property/llms-full.txt) | The size value of Dimension. |

#### Methods

| Method | Description |
|---|---|
| [reset](https://docs.textcontrol.com/tx-sheet-control/reference/typescript-api/browser/dimension/reset-method/llms-full.txt) | Remove the dimension override. |
| [setHeight](https://docs.textcontrol.com/tx-sheet-control/reference/typescript-api/browser/dimension/setheight-method/llms-full.txt) | Set a row height in points or pixels. |
| [setHidden](https://docs.textcontrol.com/tx-sheet-control/reference/typescript-api/browser/dimension/sethidden-method/llms-full.txt) | Sets explicit visibility, retaining cell data and size. Undoable; sheet protection applies. |
| [setWidth](https://docs.textcontrol.com/tx-sheet-control/reference/typescript-api/browser/dimension/setwidth-method/llms-full.txt) | Set a column width in characters or pixels. |

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

```typescript
import type { Workbook } from '@txtextcontrol/tx-sheet-control';

function createDimensionReport(book: Workbook) {
    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

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

---

## In This Section

- [Dimension.axis Property](https://docs.textcontrol.com/tx-sheet-control/reference/typescript-api/browser/dimension/axis-property/llms-full.txt): Dimension.axis property in the TX Sheet Control TypeScript API for the browser, with its type "row" | "column" and a TypeScript example.
- [Dimension.hidden Property](https://docs.textcontrol.com/tx-sheet-control/reference/typescript-api/browser/dimension/hidden-property/llms-full.txt): Dimension.hidden property in the TX Sheet Control TypeScript API for the browser: Whether this dimension is explicitly hidden (independent of AutoFilter).
- [Dimension.index Property](https://docs.textcontrol.com/tx-sheet-control/reference/typescript-api/browser/dimension/index-property/llms-full.txt): Dimension.index property in the TX Sheet Control TypeScript API for the browser, with its type number and a TypeScript example.
- [Dimension.reset Method](https://docs.textcontrol.com/tx-sheet-control/reference/typescript-api/browser/dimension/reset-method/llms-full.txt): Dimension.reset method in the browser TypeScript API: Remove the dimension override. Covers the return type Dimension and a TypeScript example.
- [Dimension.setHeight Method](https://docs.textcontrol.com/tx-sheet-control/reference/typescript-api/browser/dimension/setheight-method/llms-full.txt): Dimension.setHeight method in the TX Sheet Control TypeScript API for the browser: Set a row height in points or pixels.
- [Dimension.setHidden Method](https://docs.textcontrol.com/tx-sheet-control/reference/typescript-api/browser/dimension/sethidden-method/llms-full.txt): Dimension.setHidden method in the TX Sheet Control TypeScript API for the browser: Sets explicit visibility, retaining cell data and size. Undoable.
- [Dimension.setWidth Method](https://docs.textcontrol.com/tx-sheet-control/reference/typescript-api/browser/dimension/setwidth-method/llms-full.txt): Dimension.setWidth method in the TX Sheet Control TypeScript API for the browser: Set a column width in characters or pixels.
- [Dimension.sheet Property](https://docs.textcontrol.com/tx-sheet-control/reference/typescript-api/browser/dimension/sheet-property/llms-full.txt): Dimension.sheet property in the TX Sheet Control TypeScript API for the browser, with its type Worksheet and a TypeScript example.
- [Dimension.size Property](https://docs.textcontrol.com/tx-sheet-control/reference/typescript-api/browser/dimension/size-property/llms-full.txt): Dimension.size property in the TX Sheet Control TypeScript API for the browser, with its type number and a TypeScript example.

---

## Nearby

- **Previous:** [DEFAULT_STYLE Constant](https://docs.textcontrol.com/tx-sheet-control/reference/typescript-api/browser/default-style-constant/llms-full.txt)
- **Next:** [Dimension.axis Property](https://docs.textcontrol.com/tx-sheet-control/reference/typescript-api/browser/dimension/axis-property/llms-full.txt)
