Skip to main content
Module

x/docxml/mod.ts>Cell

TypeScript (component) library for building and parsing a DOCX file
Go to Latest
class Cell
extends Component<CellProps, CellChild>
import { Cell } from "https://deno.land/x/docxml@5.11.2/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.

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