Table of Contents

Class Table

Namespace
MiPdf.Layout
Assembly
MiPdf.dll

A table with relative column widths. Rows are created automatically from the added cells (honoring column and row spans). Header rows are repeated on every page; rows taller than a page are split across pages.

public sealed class Table : LayoutElement
Inheritance
Table
Inherited Members

Constructors

Table(params double[])

Creates a table with relative column widths, e.g. new Table(1, 3, 1).

public Table(params double[] relativeColumnWidths)

Parameters

relativeColumnWidths double[]

Properties

AlternateRowBackground

Background for every second body row (zebra striping).

public PdfColor? AlternateRowBackground { get; set; }

Property Value

PdfColor?

BorderColor

Default border color of the cells (default black).

public PdfColor BorderColor { get; set; }

Property Value

PdfColor

BorderWidth

Default border width of the cells in points (default 0.5; 0 = no borders).

public double BorderWidth { get; set; }

Property Value

double

CellPadding

Default inner padding of the cells in points (default 4 horizontal, 3 vertical).

public Thickness CellPadding { get; set; }

Property Value

Thickness

ColumnCount

Number of columns.

public int ColumnCount { get; }

Property Value

int

Font

Default font for text in body cells (default Helvetica).

public PdfFont Font { get; set; }

Property Value

PdfFont

FontSize

Default font size in points for cell text (default 9).

public double FontSize { get; set; }

Property Value

double

HeaderBackground

Background of header cells (default light gray; null = none).

public PdfColor? HeaderBackground { get; set; }

Property Value

PdfColor?

HeaderFont

Default font for text in header cells (default Helvetica-Bold).

public PdfFont HeaderFont { get; set; }

Property Value

PdfFont

RepeatHeader

Repeat the header rows at the top of every page the table continues on (default true).

public bool RepeatHeader { get; set; }

Property Value

bool

SplitRowsAcrossPages

Split rows that are taller than a whole page across pages (default true). Rows that merely do not fit on the current page are moved to the next page; rows connected by row spans are kept together.

public bool SplitRowsAcrossPages { get; set; }

Property Value

bool

WidthPercent

Table width as percentage of the available width.

public double WidthPercent { get; set; }

Property Value

double

Methods

AddCell(Cell)

Adds a body cell and returns it. Cells fill the rows from left to right.

public Cell AddCell(Cell cell)

Parameters

cell Cell

Returns

Cell

AddCell(LayoutElement)

Adds a body cell containing element and returns it.

public Cell AddCell(LayoutElement element)

Parameters

element LayoutElement

Returns

Cell

AddCell(string)

Adds a body cell containing text and returns it.

public Cell AddCell(string text)

Parameters

text string

Returns

Cell

AddHeaderCell(Cell)

Adds a header cell and returns it. Leading rows that consist only of header cells form the table header.

public Cell AddHeaderCell(Cell cell)

Parameters

cell Cell

Returns

Cell

AddHeaderCell(string)

Adds a header cell containing text and returns it.

public Cell AddHeaderCell(string text)

Parameters

text string

Returns

Cell

WithColumns(int)

Creates a table with columns equally wide columns.

public static Table WithColumns(int columns)

Parameters

columns int

Returns

Table