Class Cell
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
Cell(string, int, int)
Creates a cell containing text (see Add(string)).
public Cell(string text, int colSpan = 1, int rowSpan = 1)
Parameters
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
BorderColor
Overrides the table's default border color.
public PdfColor? BorderColor { get; set; }
Property Value
BorderWidth
Overrides the table's default border width (0 = no border).
public double? BorderWidth { get; set; }
Property Value
ColSpan
Number of columns the cell spans (limited to the columns remaining in the row).
public int ColSpan { get; }
Property Value
Content
The block elements added with Add(LayoutElement); they are rendered after text added with Add(string).
public IReadOnlyList<LayoutElement> Content { get; }
Property Value
Font
Font for text added with Add(string) (defaults to the table's font).
public PdfFont? Font { get; set; }
Property Value
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
Padding
Overrides the table's default padding.
public Thickness? Padding { get; set; }
Property Value
RowSpan
Number of rows the cell spans.
public int RowSpan { get; }
Property Value
TextAlignment
Alignment applied to text added with Add(string).
public TextAlignment? TextAlignment { get; set; }
Property Value
TextColor
Color of text added with Add(string) (defaults to black).
public PdfColor? TextColor { get; set; }
Property Value
VerticalAlignment
Vertical alignment of the cell content within the row height (default Top).
public VerticalAlignment VerticalAlignment { get; set; }
Property Value
Methods
Add(LayoutElement)
Adds a block element (paragraph, image, nested table, ...) to the cell.
public Cell Add(LayoutElement element)
Parameters
elementLayoutElement
Returns
Add(string)
Adds text formatted with the cell/table defaults.
public Cell Add(string text)
Parameters
textstring