Skip to main content
Deno 2 is finally here 🎉️
Learn more
Module

x/docxml/mod.ts>Cell

TypeScript (component) library for building and parsing a DOCX file
Latest
class Cell
extends Component<CellProps, CellChild>
import { Cell } from "https://deno.land/x/docxml@5.15.3/mod.ts";

A component that represents a table cell.

For MS Word to be happy any cell needs to have a paragraph as the last child. This component will quietly fix that for you if you don't have a paragraph there already.

Constructors

new
Cell(cellProps: CellProps, ...cellChild: CellChild[])

Methods

isMergedAway(ancestry: ComponentAncestor[]): boolean

Returns true when this cell has no visual representation because a column-spanning or row- spanning neighbour overlaps it.

toNode(ancestry: ComponentAncestor[]): Promise<Node>

Creates an XML DOM node for this component instance.

toRepeatingNode(
ancestry: ComponentAncestor[],
column: number,
_row: number,
): Node | null

Static Properties

readonly
children: string[]
readonly
mixed: boolean

Static Methods

fromNode(node: Node, context: ComponentContext): null | Cell

Instantiate this component from the XML in an existing DOCX file.

matchesNode(node: Node): boolean

Asserts whether or not a given XML node correlates with this component.