Table of Contents

Class DocxCell

Namespace
PDiffy
Assembly
PDiffy.dll

A table cell. Span is how many grid columns it covers; Merge is "restart" for the top of cells merged down a column and "continue" for those below it; Shading is its fill color in hex. Width, margins and borders are written as for DocxTable.

public sealed record DocxCell : IEquatable<DocxCell>
Inheritance
DocxCell
Implements
Inherited Members

Properties

Blocks

The paragraphs, tables and other blocks in the cell.

public required IReadOnlyList<DocxBlock> Blocks { get; init; }

Property Value

IReadOnlyList<DocxBlock>

Borders

The cell's own borders, one per side the cell sets.

public IReadOnlyList<DocxBorder> Borders { get; init; }

Property Value

IReadOnlyList<DocxBorder>

Controls

The content controls around the cell, outermost first.

public IReadOnlyList<DocxControl> Controls { get; init; }

Property Value

IReadOnlyList<DocxControl>

Margins

The cell's own margins, used instead of CellMargins on those sides.

public IReadOnlyList<DocxMargin> Margins { get; init; }

Property Value

IReadOnlyList<DocxMargin>

Merge

"restart" or "continue" (DocxCellMerges), or null when it isn't merged with the cells above or below it.

public string? Merge { get; init; }

Property Value

string

Other

A hash of the cell's own formatting PDiffy doesn't read, such as w:noWrap, so changing it changes the snapshot; null when it has none. Only its own formatting counts, not what it inherits, and noise Word writes everywhere is left out.

public string? Other { get; init; }

Property Value

string

Revisions

Tracked changes to the cell: CellInsert, CellDelete, CellMerge or CellFormat.

public IReadOnlyList<DocxRevision> Revisions { get; init; }

Property Value

IReadOnlyList<DocxRevision>

Shading

The fill color in uppercase hex, such as "D9E2F3", or null when the cell has no fill.

public string? Shading { get; init; }

Property Value

string

Span

How many columns of the table's grid the cell covers, 1 unless it's merged across.

public int Span { get; init; }

Property Value

int

TextDirection

The direction of the cell's text when the cell sets one, as Word writes it, such as "btLr"; DocxTextDirections lists them.

public string? TextDirection { get; init; }

Property Value

string

VerticalAlign

Where the text sits in the cell as Word writes it, such as "center" or "bottom"; DocxCellVerticalAligns lists them.

public string? VerticalAlign { get; init; }

Property Value

string

Width

The cell's width, such as 120 points or 25%, or null when the cell doesn't set one.

public DocxWidth? Width { get; init; }

Property Value

DocxWidth