Table of Contents

Class XlsxTables

Namespace
DocWright.Spreadsheet
Assembly
DocWright.Spreadsheet.dll

The tables of one sheet of an opened workbook (Phase 203), as Excel's Format as Table makes them: listed, added, resized, restyled and removed, and written the way Excel writes its own.

public sealed class XlsxTables : IReadOnlyList<XlsxTable>, IReadOnlyCollection<XlsxTable>, IEnumerable<XlsxTable>, IEnumerable
Inheritance
XlsxTables
Implements
Inherited Members

Remarks

Measured with Excel (tools/Probe-ExcelTables.ps1): a table's columns are named from its header cells, an empty header ColumnN and a repeated one with a number after it, from one count shared by both; the header cells then hold those names as text. A table's name (the one formulas use) is unique in the workbook, without regard to case, among tables and defined names; it has no space and is not a cell's name. Tables do not overlap.

Properties

Count

Gets the number of tables.

this[int]

Gets a table by its place in the list.

Methods

Add(XlsxCellRange, string?, bool)

Makes a range a table, as Excel's Format as Table does: Excel's default style (TableStyleMedium2, row stripes), the columns named from the header cells, which then hold those names as text, merged cells inside unmerged. A range without a header row becomes a table whose header row is turned off, its columns named Column1 on: no cell moves (Excel's own command inserts a row above instead).

Find(string)

Returns a table of this sheet by its name, without regard to case; null when the sheet has none.

GetEnumerator()

Returns the tables, in the order the sheet lists them.