docx
    Preparing search index...

    Class Table

    Represents a table in a WordprocessingML document.

    A table is a set of paragraphs (and other block-level content) arranged in rows and columns. Tables are used to organize content into a grid structure.

    Reference: http://officeopenxml.com/WPtable.php

    <xsd:complexType name="CT_Tbl">
    <xsd:sequence>
    <xsd:group ref="EG_RangeMarkupElements" minOccurs="0" maxOccurs="unbounded"/>
    <xsd:element name="tblPr" type="CT_TblPr"/>
    <xsd:element name="tblGrid" type="CT_TblGrid"/>
    <xsd:group ref="EG_ContentRowContent" minOccurs="0" maxOccurs="unbounded"/>
    </xsd:sequence>
    </xsd:complexType>
    new Table({
    rows: [
    new TableRow({
    children: [
    new TableCell({ children: [new Paragraph("Cell 1")] }),
    new TableCell({ children: [new Paragraph("Cell 2")] }),
    ],
    }),
    ],
    });

    Hierarchy (View Summary)

    Index
    fileChild: symbol = ...

    Marker property identifying this as a FileChild

    • get ColumnWidths(): readonly number[]

      Widths of the grid columns in twips, as they will be written to w:tblGrid.

      These are the explicit columnWidths when given, otherwise the widths derived from the table and cell widths. Derived widths are resolved against the page (or the parent cell for nested tables) during serialization, so before that they reflect the default page size.

      Returns readonly number[]

    • get writtenAs(): readonly BaseXmlComponent[] | undefined
      Internal

      The components written in this one's place, one after another, when it can't be written as a single element, such as a run with another run in its children. Undefined when it is written as itself.

      Returns readonly BaseXmlComponent[] | undefined

    • Width in twips, according to the grid, of a cell in one of this table's rows.

      Used by nested tables to resolve their own widths against the cell they sit in.

      Parameters

      Returns number | undefined

      The summed width of the grid columns the cell spans, or undefined if the cell cannot be located on the grid