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

    Class Table

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

    1. Filtering
    2. Dynamic Styling
    3. External data
    4. Structured formulas

    Hierarchy

    • AnchoredTable
      • Table

    Implements

    Index
    • get "[toStringTag]"(): string

      Returns string

    • get isIAnchored(): true

      For runtime type checking.

      Returns true

    • get isITable(): true

      For runtime type checking.

      Returns true

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

      • count: number = 1

        The number of rows to add. Defaults to 1.

      • Optionaloptions: ITransaction.OperationOptions

      Returns this

      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.

    • Batches all 'transactional' changes until they have all be committed or rolled back.

      Parameters

      • Optionaloptions: string | ITransaction.OperationOptions

        Description of the operation or additional options. Used for tracking undo/redo and history. Default Value User Operation.

      Returns ITransaction

      Any changes that are made to this object will be reflected in the local record but not committed to the transactional store until the batch is popped.

      Useful for operations that are longer running but generally not recommended as it keeps a transaction open. doBatch is the preferred option.

    • 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).

    • Delete the rows from the table.

      Parameters

      Returns this

      Not implemented

    • Provides a mechanism to perform a set of operations in a batch.

      Type Parameters

      • R

      Parameters

      • callback: (commit: ICommit) => R | Promise<R>

        A callback that performs multiple operations all within the same transaction.

      • Optionaloptions: string | ITransaction.OperationOptions

        Description of the operation or additional options. Used for tracking undo/redo and history. Default Value User Operation.

      Returns R | Promise<R>

      Writes are tracked automatically: a batch that performs no state updates (a read-only batch) is elided — the commit id is unchanged, no events fire, and nothing is added to the undo stack or commit log.

    • 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<Table>

      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 → ...).

    • The anchor coordinates in authored order, or null when unanchored.

      Returns Coords[] | null

      Deliberately not on IAnchored: coordinates are the internal representation, and the public contract is ranges (getRanges / the single-range getRange() each concrete type declares). Kept here so subclasses can read their own geometry without paying for a range.

    • Returns the columns for this table.

      Parameters

      • key: string

      Returns IColumn | null

    • 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 the columns for this table.

      Parameters

      • id: string

      Returns IColumn | null

    • Returns the columns for this table.

      Parameters

      • name: string

      Returns IColumn | null

    • 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 first anchor coordinates, or null when unanchored.

      Returns Coords | null

      The coords-level peer of getRange. Like getAnchorCoords, not on IAnchored — see there.

    • A unique identifier for the record. This will never change.

      Returns string

      This enables the record to be identified across transactions and users in a collaborative environment. The id is store-issued (IStore.create); the store keys all state by it.

    • Returns string

      setName

    • 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 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.
    • Every committed update gives the record a new, strictly increasing version id.

      Returns number

      Used with getId to uniquely identify a version of the record.

      The id is an identity, not a per-record count: ids are drawn from a single store-wide sequence bumped once per commit, so all records written in the same commit share an id and a given record's ids increase but are not sequential.

      Records are immutable so a restore/revert doesn't change them — it repoints, and the version id reported is the one for the snapshot the store is currently at. Version ids are never reused: a write after an undo receives an id higher than any previously issued, so a stale reader can always detect the change.

    • 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

    • A table is deleted when its state says so - and when it has no state at all.

      Returns boolean

      Undoing the commit that created a table (an add, a paste, the re-add of a cut) removes its state but cannot close the instance: a redo brings the state back, and the sheet's table map hands out this same instance again. In between it is a deleted table.

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

    • This is the alternative text use for assistive technologies.

      Parameters

      Returns this

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

    • Returns the address as a string.

      Returns string

    • Updates the table StyleInfo.

      Parameters

      • options: StyleOptions

        Style options unique to the table.

      • description: string = ...

      Returns this

      This will merge with the existing values.