Table of Contents

Class Cell

Namespace
MiPdf.Layout
Assembly
MiPdf.dll

A table cell. Contains block elements (paragraphs, images, nested tables).

public sealed class Cell
Inheritance
Cell
Inherited Members

Constructors

Cell(int, int)

Creates an empty cell spanning the given number of columns and rows (values below 1 are treated as 1).

public Cell(int colSpan = 1, int rowSpan = 1)

Parameters

colSpan int
rowSpan int

Cell(string, int, int)

Creates a cell containing text (see Add(string)).

public Cell(string text, int colSpan = 1, int rowSpan = 1)

Parameters

text string
colSpan int
rowSpan int

Properties

Background

Background color of the cell; overrides the table's header and alternate row backgrounds (null = table default).

public PdfColor? Background { get; set; }

Property Value

PdfColor?

BorderColor

Overrides the table's default border color.

public PdfColor? BorderColor { get; set; }

Property Value

PdfColor?

BorderWidth

Overrides the table's default border width (0 = no border).

public double? BorderWidth { get; set; }

Property Value

double?

ColSpan

Number of columns the cell spans (limited to the columns remaining in the row).

public int ColSpan { get; }

Property Value

int

Content

The block elements added with Add(LayoutElement); they are rendered after text added with Add(string).

public IReadOnlyList<LayoutElement> Content { get; }

Property Value

IReadOnlyList<LayoutElement>

Font

Font for text added with Add(string) (defaults to the table's font).

public PdfFont? Font { get; set; }

Property Value

PdfFont

FontSize

Font size in points for text added with Add(string) (defaults to the table's font size).

public double? FontSize { get; set; }

Property Value

double?

Padding

Overrides the table's default padding.

public Thickness? Padding { get; set; }

Property Value

Thickness?

RowSpan

Number of rows the cell spans.

public int RowSpan { get; }

Property Value

int

TextAlignment

Alignment applied to text added with Add(string).

public TextAlignment? TextAlignment { get; set; }

Property Value

TextAlignment?

TextColor

Color of text added with Add(string) (defaults to black).

public PdfColor? TextColor { get; set; }

Property Value

PdfColor?

VerticalAlignment

Vertical alignment of the cell content within the row height (default Top).

public VerticalAlignment VerticalAlignment { get; set; }

Property Value

VerticalAlignment

Methods

Add(LayoutElement)

Adds a block element (paragraph, image, nested table, ...) to the cell.

public Cell Add(LayoutElement element)

Parameters

element LayoutElement

Returns

Cell

Add(string)

Adds text formatted with the cell/table defaults.

public Cell Add(string text)

Parameters

text string

Returns

Cell