docx
    Preparing search index...

    Class TableCell

    Represents a table cell in a WordprocessingML document.

    A table cell is the basic unit of content within a table. Each cell can contain paragraphs, nested tables, or other block-level content. Cells must always end with a paragraph element.

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

    <xsd:complexType name="CT_Tc">
    <xsd:sequence>
    <xsd:element name="tcPr" type="CT_TcPr" minOccurs="0" maxOccurs="1"/>
    <xsd:group ref="EG_BlockLevelElts" minOccurs="1" maxOccurs="unbounded"/>
    </xsd:sequence>
    <xsd:attribute name="id" type="s:ST_String" use="optional"/>
    </xsd:complexType>
    new TableCell({
    children: [new Paragraph("Cell content")],
    width: { size: 3000, type: WidthType.DXA },
    });

    Hierarchy (View Summary)

    Index

    Constructors

    Properties

    Methods

    Constructors

    Properties

    Methods

    • Prepares this component and its children for XML serialization.

      This method is called by the Formatter to convert the component tree into an object structure compatible with the xml library (https://www.npmjs.com/package/xml). It recursively processes all children and handles special cases like attribute-only elements and empty elements.

      The method can be overridden by subclasses to customize XML representation or execute side effects during serialization (e.g., creating relationships).

      Parameters

      • context: IContext

        The serialization context containing document state

      Returns IXmlableObject | undefined

      The XML-serializable object, or undefined to exclude from output

      // Override to add custom serialization logic
      prepForXml(context: IContext): IXmlableObject | undefined {
      // Custom logic here
      return super.prepForXml(context);
      }