> ## Documentation Index
> Fetch the complete documentation index at: https://docs.reducto.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Tables and filters

## `TableCollection`

`Excel.TableCollection`: every table of the workbook, or of one worksheet.

Import from `@reductoai/xlsx/officejs`.

### TableCollection properties

| Name | Type | Description |
| - | - | - |
| `count` | `number` | read-only |
| `items` | `ExcelTable[]` | read-only |

### `TableCollection.add()`

```ts theme={null}
add(address: string | ExcelRange, hasHeaders: boolean): ExcelTable
```

A table over `address`; without headers Excel inserts a header row above the cells.

### `TableCollection.getCount()`

```ts theme={null}
getCount(): ClientResult<number>
```

### `TableCollection.getItem()`

```ts theme={null}
getItem(key: string): ExcelTable
```

By name (case-insensitive) or id.

### `TableCollection.getItemAt()`

```ts theme={null}
getItemAt(index: number): ExcelTable
```

### `TableCollection.getItemOrNullObject()`

```ts theme={null}
getItemOrNullObject(key: string): Nullable<ExcelTable>
```

## `ExcelTable`

`Excel.Table`. Edits apply at once and keep every formula that names the table in step.

Import from `@reductoai/xlsx/officejs`.

### ExcelTable properties

| Name | Type | Description |
| - | - | - |
| `autoFilter` | `AutoFilter` | read-only |
| `columns` | `TableColumnCollection` | read-only |
| `highlightFirstColumn` | `boolean` | |
| `highlightLastColumn` | `boolean` | |
| `id` | `string` | read-only |
| `legacyId` | `string` | read-only |
| `name` | `string` | |
| `rows` | `TableRowCollection` | read-only |
| `showBandedColumns` | `boolean` | |
| `showBandedRows` | `boolean` | |
| `showFilterButton` | `boolean` | Hiding the buttons shows every row the filter hid, as Excel does. |
| `showHeaders` | `boolean` | Off clears the header cells; on writes the names above, pushing the table down if that row is in use. |
| `showTotals` | `boolean` | |
| `sort` | `TableSort` | read-only |
| `style` | `string` | |
| `worksheet` | `ExcelWorksheet` | read-only |

### `ExcelTable.clearFilters()`

```ts theme={null}
clearFilters(): void
```

Shows every row and drops every column's filter.

### `ExcelTable.convertToRange()`

```ts theme={null}
convertToRange(): ExcelRange
```

Removes the table and keeps its cells and look; formulas that named it get plain ranges.

### `ExcelTable.delete()`

```ts theme={null}
delete(): void
```

Removes the table with its values and formats, as Office.js does.

### `ExcelTable.getDataBodyRange()`

```ts theme={null}
getDataBodyRange(): ExcelRange
```

### `ExcelTable.getHeaderRowRange()`

```ts theme={null}
getHeaderRowRange(): ExcelRange
```

### `ExcelTable.getRange()`

```ts theme={null}
getRange(): ExcelRange
```

### `ExcelTable.getTotalRowRange()`

```ts theme={null}
getTotalRowRange(): ExcelRange
```

### `ExcelTable.reapplyFilters()`

```ts theme={null}
reapplyFilters(): void
```

Hides and shows rows again by the filters in force.

### `ExcelTable.resize()`

```ts theme={null}
resize(newRange: string | ExcelRange): void
```

Puts the table over `newRange`; its top row stays where it is and the ranges overlap.

### `ExcelTable.set()`

```ts theme={null}
set(properties: ExcelTable | UpdateData<ExcelTable>, options?: UpdateOptions): void
```

Sets several properties at once; a navigation member takes a nested batch.

## `TableColumn`

`Excel.TableColumn`, keyed by its id in the table part.

Import from `@reductoai/xlsx/officejs`.

### TableColumn properties

| Name | Type | Description |
| - | - | - |
| `filter` | `ExcelFilter` | read-only |
| `id` | `number` | read-only |
| `index` | `number` | read-only |
| `name` | `string` | |
| `values` | `(string \| number \| boolean)[][]` | |
| `valuesAsJson` | `BasicCellValue[][]` | read-only |
| `valuesAsJsonLocal` | `BasicCellValue[][]` | read-only |

### `TableColumn.delete()`

```ts theme={null}
delete(): void
```

Deletes the column's cells, shifting the table's cells to its right left.

### `TableColumn.getDataBodyRange()`

```ts theme={null}
getDataBodyRange(): ExcelRange
```

### `TableColumn.getHeaderRowRange()`

```ts theme={null}
getHeaderRowRange(): ExcelRange
```

### `TableColumn.getRange()`

```ts theme={null}
getRange(): ExcelRange
```

### `TableColumn.getTotalRowRange()`

```ts theme={null}
getTotalRowRange(): ExcelRange
```

### `TableColumn.set()`

```ts theme={null}
set(properties: TableColumn | UpdateData<TableColumn>, options?: UpdateOptions): void
```

Sets several properties at once; a navigation member takes a nested batch.

## `TableRow`

`Excel.TableRow`: a data row by position, as Office.js keys it.

Import from `@reductoai/xlsx/officejs`.

### TableRow properties

| Name | Type | Description |
| - | - | - |
| `index` | `number` | read-only |
| `values` | `(string \| number \| boolean)[][]` | |
| `valuesAsJson` | `BasicCellValue[][]` | read-only |
| `valuesAsJsonLocal` | `BasicCellValue[][]` | read-only |

### `TableRow.delete()`

```ts theme={null}
delete(): void
```

Deletes the row's cells, shifting the table's rows below it up.

### `TableRow.getRange()`

```ts theme={null}
getRange(): ExcelRange
```

### `TableRow.set()`

```ts theme={null}
set(properties: TableRow | UpdateData<TableRow>, options?: UpdateOptions): void
```

Sets several properties at once; a navigation member takes a nested batch.

## `ExcelFilter`

`Excel.Filter` of one filter column; `scope` finds the table's or the sheet's filter.

Import from `@reductoai/xlsx/officejs`.

### ExcelFilter properties

| Name | Type | Description |
| - | - | - |
| `criteria` | `FilterCriteria \| null` | read-only The criteria in force, or null when the column does not filter. |

### `ExcelFilter.apply()`

```ts theme={null}
apply(criteria: FilterCriteria): void
```

### `ExcelFilter.applyBottomItemsFilter()`

```ts theme={null}
applyBottomItemsFilter(count: number): void
```

### `ExcelFilter.applyBottomPercentFilter()`

```ts theme={null}
applyBottomPercentFilter(percent: number): void
```

### `ExcelFilter.applyCellColorFilter()`

```ts theme={null}
applyCellColorFilter(color: string): void
```

"" shows the cells with no fill.

### `ExcelFilter.applyCustomFilter()`

```ts theme={null}
applyCustomFilter(criteria1: string, criteria2?: string, oper?: "And" | "Or"): void
```

Criteria such as ">=5", "=ap\*" or "\<>" (not blank); two join with `oper`, And by default.

### `ExcelFilter.applyDynamicFilter()`

```ts theme={null}
applyDynamicFilter(criteria: string): void
```

### `ExcelFilter.applyFontColorFilter()`

```ts theme={null}
applyFontColorFilter(color: string): void
```

"" shows the cells in the automatic font colour.

### `ExcelFilter.applyIconFilter()`

```ts theme={null}
applyIconFilter(icon: Icon): void
```

Written for Excel; rows keep their state here, as icon state is a view matter.

### `ExcelFilter.applyTopItemsFilter()`

```ts theme={null}
applyTopItemsFilter(count: number): void
```

### `ExcelFilter.applyTopPercentFilter()`

```ts theme={null}
applyTopPercentFilter(percent: number): void
```

### `ExcelFilter.applyValuesFilter()`

```ts theme={null}
applyValuesFilter(values: string[]): void
```

### `ExcelFilter.clear()`

```ts theme={null}
clear(): void
```

## `AutoFilter`

`Excel.AutoFilter` of a worksheet (its own filter buttons) or of one table.

Import from `@reductoai/xlsx/officejs`.

### AutoFilter properties

| Name | Type | Description |
| - | - | - |
| `criteria` | `FilterCriteria[]` | read-only One entry per column; `filterOn` is "Values" with no values when a column does not filter. |
| `enabled` | `boolean` | read-only |
| `isDataFiltered` | `boolean` | read-only |

### `AutoFilter.apply()`

```ts theme={null}
apply(range: string | ExcelRange, columnIndex?: number, criteria?: FilterCriteria): void
```

Turns the filter on over `range` (one cell takes its current region, as Excel does) and,
with `columnIndex` and `criteria`, filters that column. A new range drops the old criteria.

### `AutoFilter.clearColumnCriteria()`

```ts theme={null}
clearColumnCriteria(columnIndex: number): void
```

### `AutoFilter.clearCriteria()`

```ts theme={null}
clearCriteria(): void
```

### `AutoFilter.getRange()`

```ts theme={null}
getRange(): ExcelRange
```

### `AutoFilter.getRangeOrNullObject()`

```ts theme={null}
getRangeOrNullObject(): ExcelRange & { isNullObject: boolean }
```

### `AutoFilter.reapply()`

```ts theme={null}
reapply(): void
```

### `AutoFilter.remove()`

```ts theme={null}
remove(): void
```

Shows every row and removes the filter buttons.
