SheetXL - v0.8.0-beta.9+sites.210.e2d420901
    Preparing search index...

    Interface ITable

    A Table is an embedded table that allows for advanced capabilities.

    1. Filtering
    2. Dynamic Styling
    3. External data
    4. Structured formulas
    interface ITable {
        isIAnchored: true;
        isITable: true;
        addColumn(
            index?: number,
            values?: Scalar[],
            name?: string,
            options?: ITransaction.OperationOptions,
        ): IColumn;
        addListeners(
            listeners: ITable.IListeners,
            options?: IListener.Options,
        ): Remove;
        addRow(index?: number, options?: ITransaction.OperationOptions): this;
        addRows(
            index: number,
            count?: number,
            options?: ITransaction.OperationOptions,
        ): ITable;
        applyFilters(options?: ITransaction.OperationOptions): Promise<ITable>;
        applySorts(options?: ITransaction.OperationOptions): this;
        applySortsAndFilters(
            options?: ITransaction.OperationOptions,
        ): Promise<ITable>;
        close(): void;
        convertToRange(
            maxCells?: number,
            options?: ITransaction.OperationOptions,
        ): ICellRange;
        delete(options?: ITransaction.OperationOptions): void;
        deleteFilters(options?: ITransaction.OperationOptions): Promise<ITable>;
        deleteRowsAt(
            index: number,
            count?: number,
            options?: ITransaction.OperationOptions,
        ): ITable;
        deleteSorts(options?: ITransaction.OperationOptions): this;
        deleteSortsAndFilters(
            options?: ITransaction.OperationOptions,
        ): Promise<ITable>;
        filter(
            conditions?: ICondition.RangeOptions | Input<any>,
            options?: ITransaction.OperationOptions,
        ): Promise<ITable>;
        getActiveFilters(): readonly IFilter[];
        getActiveSorts(): readonly ISort[];
        getAnchorType?(): IAnchored.Type;
        getAutoExpand(): ITable.AutoExpand;
        getColumn(key: string): IColumn | null;
        getColumnAt(index: number): IColumn | null;
        getColumnById(id: string): IColumn | null;
        getColumnByName(name: string): IColumn | null;
        getColumns(): readonly IColumn[];
        getDataRange(): ICellRange;
        getDescription(): string;
        getFilterAt(index: number): IFilter | null;
        getFormulaBelow(): ITable.FormulaBelow;
        getHeaderRowRange(): ICellRange;
        getId(): string;
        getName(): string;
        getNamed(): INamed<any> | null;
        getRange(): ICellRange;
        getRangedStyle(): ICellRanged<IStyle.Properties<Serializable>>;
        getRanges(options?: ICellRange.GetRangeOptions): ICellRanges;
        getSheet(): ISheet | null;
        getSnapshot(options?: CopyOptions): ITable.ISnapshot;
        getSortAt(index: number): ISort | null;
        getStyle(): ITableStyle;
        getStyleAt(coords: CellCoords): IStyle;
        getStyleOptions(): StyleOptions;
        getTotalRowRange(): ICellRange;
        getVisibleCellCoords(coords: CellCoords): CellCoords;
        getVisibleRefRangeCoords(): Coords;
        isClosed(): boolean;
        isDeleted(): boolean;
        isDisabledColumnFill(): boolean;
        isFirstColumnVisible(): boolean;
        isHeaderVisible(): boolean;
        isHiddenButtonAt(index: number): boolean;
        isHiddenButtons(): boolean;
        isLastColumnVisible(): boolean;
        isProtected(): boolean;
        isShowBandedColumns(): boolean;
        isShowBandedRows(): boolean;
        isShowHeaders(): boolean;
        isShowHighlightFirstColumn(): boolean;
        isShowHighlightLastColumn(): boolean;
        isShowTotals(): boolean;
        isTotalVisible(): boolean;
        resize(
            address: ICellRange.Address,
            options?: ITransaction.OperationOptions,
        ): ICellRange;
        resizeTo(
            rowCount: number,
            colCount: number,
            options?: ITransaction.OperationOptions,
        ): ICellRange;
        select(options?: ICellRange.SelectOptions): Promise<ICellRange>;
        setAutoExpand(
            autoExpand: ITable.AutoExpand,
            options?: ITransaction.OperationOptions,
        ): this;
        setDescription(
            description: string | null,
            options?: ITransaction.OperationOptions,
        ): ITable;
        setDisabledColumnFill(
            disabledColumnFill: boolean,
            options?: ITransaction.OperationOptions,
        ): this;
        setFormulaBelow(
            formulaBelow: ITable.FormulaBelow,
            options?: ITransaction.OperationOptions,
        ): this;
        setHiddenButtonAt(index: number, hidden: boolean): this;
        setHiddenButtons(hidden: boolean): this;
        setName(name: string, options?: ITransaction.OperationOptions): ITable;
        setShowBandedColumns(
            showBandedColumns: boolean,
            options?: ITransaction.OperationOptions,
        ): this;
        setShowBandedRows(
            showBandedRows: boolean,
            options?: ITransaction.OperationOptions,
        ): this;
        setShowHeaders(
            showHeaders: boolean,
            options?: ITransaction.OperationOptions,
        ): this;
        setShowHighlightFirstColumn(
            showHighlightFirstColumn: boolean,
            options?: ITransaction.OperationOptions,
        ): this;
        setShowHighlightLastColumn(
            showHighlightLastColumn: boolean,
            options?: ITransaction.OperationOptions,
        ): this;
        setShowTotals(
            showTotals: boolean,
            options?: ITransaction.OperationOptions,
        ): this;
        sort(options?: ISort.RangeOptions & ITransaction.OperationOptions): this;
        toJSON(): ITable.JSON | null;
        updateStyleOptions(options: StyleOptions): ITable;
    }

    Hierarchy (View Summary)

    Implemented by

    Index
    isIAnchored: true

    For runtime type checking.

    isITable: true

    For runtime type checking.

    • Add a single column.

      Parameters

      Returns IColumn

      Not implemented To remove columns use the resize

    • Add a single row to the table.

      Parameters

      • Optionalindex: number

        The body row the new row goes in before, 0 being the first. Omitted, the row is added at the end.

      • Optionaloptions: ITransaction.OperationOptions

      Returns this

      This is a convenience method for (index, 1)

    • Add a number of rows to a table.

      Parameters

      • index: number

        The body row the new rows go in before, 0 being the first. An index at or past the number of body rows adds them at the end, above the totals row if there is one.

      • Optionalcount: number

        The number of rows to add. Defaults to 1.

      • Optionaloptions: ITransaction.OperationOptions

      Returns ITable

      The rows are inserted across the table's columns only: cells below the table move down, and cells beside it stay where they are. A calculated column gives the new rows its formula.

      table.addRows(0, 2); // two rows at the top of the body
      table.addRow(); // one at the end
    • Applies all filters using the existing criteria.

      Parameters

      Returns Promise<ITable>

      Resolves once the rows are hidden; one transaction, one undo step.

      Does not change criteria; only recomputes which rows are visible.

    • Similar to delete but cleans resources and can't be undone.

      Returns void

    • Convert the existing table to a range. This will remove the table but preserve the original data and formatting.

      Parameters

      Returns ICellRange

      This can be an expensive operation.

      A formula that references the table has each reference replaced by the absolute address it designated (Sheet1!$A$2:$C$4).

    • Replaces the filter levels and hides the rows that fail them.

      Parameters

      • Optionalconditions: ICondition.RangeOptions | Input<any>

        undefined or { conditions: [] } → clears every filter, as deleteFilters.

        • a bare ICondition.Input → one filter on the first column, as ICellRange.filter.
        • { conditions: [...] } → one level per condition, on the column each index names (its position in the array when omitted), in that order.
      • Optionaloptions: ITransaction.OperationOptions

      Returns Promise<ITable>

      Resolves once the rows are hidden; one transaction, one undo step.

      Every row the table holds is judged, whatever hid it before (includeHidden defaults to true for a filter); the header and totals rows are never evaluated or hidden.

    • Returns the active filter entries as handle objects,

      Returns readonly IFilter[]

    • Returns the active sorts ordered by priority.

      Returns readonly ISort[]

      These are ordered by priority (primary → secondary → ...).

    • Returns a column for the given name or ID.

      Parameters

      • key: string

        The name of the column.

      Returns IColumn | null

      The column or null if not found.

    • Returns an column for the given index.

      Parameters

      • index: number

        The index of the column.

      Returns IColumn | null

      The column or null if not found.

    • Returns a column for the given ID.

      Parameters

      • id: string

        The id of the column.

      Returns IColumn | null

      The column or null if not found.

    • Returns a column for the given name.

      Parameters

      • name: string

        The name of the column.

      Returns IColumn | null

      The column or null if not found.

    • Returns the columns for this table.

      Returns readonly IColumn[]

    • Get the range between the header and the total.

      Returns ICellRange

      Excel calls this the getRangeBetweenHeaderAndTotal()

    • Returns the filter at the specified index, or null if none.

      Parameters

      • index: number

      Returns IFilter | null

    • The unique id of the table.

      Returns string

      This will not change during the lifetime of the table.

    • The table's entry in the workbook's names, or null if it is not named.

      Returns INamed<any> | null

      A table's name is derived — it exists because the table does. The name collection reads this rather than being handed a copy, so a deleted table stops being named without anything having to remove it.

    • Returns the range for the entire table.

      Returns ICellRange

      A table occupies exactly one rectangle, which is why the singular is declared here rather than on IAnchored. Invalid, never null, once the table is no longer anchored.

    • Returns the table style resolved against this table's geometry, as a per-cell properties provider.

      Returns ICellRanged<IStyle.Properties<Serializable>>

      The instance is memoized per table (and invalidated on any table or table-styles change), so it can cache per-cell resolutions. Prefer this over getStyle().getRanged(table), which allocates a fresh uncached instance.

    • Returns the ranges this object is anchored to, in authored order.

      Parameters

      Returns ICellRanges

      • Never null. An item whose last range was removed by a row/column delete returns an invalid ranges — ask ICellRanges.isInvalid, the same contract as ITable.getDataRange.
      • This is the general accessor. Most anchored types hold exactly one range and declare their own getRange() for it, but data validations, conditional formats and protected ranges are authored as several, and any single range can become several when a delete splits it.
    • Returns the sheet the table is associated with.

      Returns ISheet | null

    • Returns a snapshot of the table that can be used for copying and archiving.

      Parameters

      • Optionaloptions: CopyOptions

      Returns ITable.ISnapshot

    • Returns the sort at the specified index.

      Parameters

      • index: number

      Returns ISort | null

      A sort object (which may have a null criteria) or null if the index is invalid or the table is closed.

    • Returns a cell style for the given coords.

      Parameters

      • coords: CellCoords

        The absolute coords.

      Returns IStyle

      This will return a CellStyle rendered with the table styling but not any other styling.

      • This is used by the preview.
    • Returns the coords after any hidden values are applied.

      Parameters

      • coords: CellCoords

        The absolute coords

      Returns CellCoords

    • Returns the bounds for the ref accounting for hidden headers.

      Returns Coords

      This is used for borders and drag areas that are based on visible edges. excluding hidden rows/columns (headers).

    • Returns if the model has been closed

      Returns boolean

    • Returns if the model has been deleted

      Returns boolean

    • Returns if the table is set to not fill a formula down its column.

      Returns boolean

    • Returns a flag indicating if the first column is visible due to hidden headers.

      Returns boolean

    • Returns a flag indicating if the header is visible due to hidden headers.

      Returns boolean

      To know if the header flag is set use isShowHeaders

    • Returns whether the filter/sort button at the specified index is hidden.

      Parameters

      • index: number

      Returns boolean

    • This will only return true if all buttons are hidden.

      Returns boolean

    • Returns a flag indicating if the first column is visible due to hidden headers.

      Returns boolean

    • If the anchor is unable to be modified.

      Returns boolean

    • Specifies if banded columns is being applied.

      Returns boolean

    • Specifies if banded rows is being applied.

      Returns boolean

    • Specifies if headers are being shown for the table.

      Returns boolean

    • Specifies if first column is being highlighted.

      Returns boolean

    • Specifies if last column is being highlighted.

      Returns boolean

    • Specifies if totals are being shown for the table.

      Returns boolean

    • Returns a flag indicating if the footer is visible due to hidden headers.

      Returns boolean

    • Resizes the current range to the specified ending row and column indices.

      Parameters

      Returns ICellRange

      ICellRange with the resized range.

      This is slightly different that ICellRange.getSizeTo in that it is relative.

    • If true a formula entered into one cell of an empty column is not filled down the column.

      Parameters

      Returns this

      A column that is already calculated keeps its formula, and rows added to the table are still given it.

    • Sets whether the filter/sort button at the specified index is hidden.

      Parameters

      • index: number
      • hidden: boolean

      Returns this

    • If hidden is true then all filter/sort buttons are hidden.

      Parameters

      • hidden: boolean

      Returns this

    • Returns ITable.JSON | null

      The current state as a JSON object or null if the table is closed.

    • Updates the table StyleInfo.

      Parameters

      Returns ITable

      This will merge with the existing values.