Class TableCell
One logical cell in a table row.
Inherited Members
Namespace: DRIT.Pdf.Content
Assembly: DRIT.Pdf.dll
Syntax
public sealed class TableCell
Properties
BackgroundColor
Gets or sets the background color.
Declaration
public PdfColor? BackgroundColor { get; set; }
Property Value
| Type | Description |
|---|---|
| PdfColor? |
Border
Gets or sets the cell border.
Declaration
public TableBorder? Border { get; set; }
Property Value
| Type | Description |
|---|---|
| TableBorder |
FontFamily
Gets or sets the font family.
Declaration
public PdfFontFamily? FontFamily { get; set; }
Property Value
| Type | Description |
|---|---|
| PdfFontFamily |
FontSize
Gets or sets the font size in points. Default is 11.
Declaration
public double FontSize { get; set; }
Property Value
| Type | Description |
|---|---|
| double |
ForegroundColor
Gets or sets the foreground (text) color. Default is Black.
Declaration
public PdfColor ForegroundColor { get; set; }
Property Value
| Type | Description |
|---|---|
| PdfColor |
HorizontalAlignment
Gets or sets the horizontal text alignment. Default is Left.
Declaration
public TextAlignment HorizontalAlignment { get; set; }
Property Value
| Type | Description |
|---|---|
| TextAlignment |
Image
Gets the image in this cell, if any.
Declaration
public PdfImage? Image { get; }
Property Value
| Type | Description |
|---|---|
| PdfImage |
ImageSize
Gets the image size override, if any.
Declaration
public PdfSize? ImageSize { get; }
Property Value
| Type | Description |
|---|---|
| PdfSize? |
IsWordWrapped
Gets or sets whether text wrapping is enabled. Default is true.
Declaration
public bool IsWordWrapped { get; set; }
Property Value
| Type | Description |
|---|---|
| bool |
Padding
Gets or sets the cell padding. Default is 2 points on all sides.
Declaration
public TablePadding? Padding { get; set; }
Property Value
| Type | Description |
|---|---|
| TablePadding |
Text
Gets or sets the cell text content.
Declaration
public string Text { get; set; }
Property Value
| Type | Description |
|---|---|
| string |
VerticalAlignment
Gets or sets the vertical text alignment. Default is Top.
Declaration
public PdfVerticalAlignment VerticalAlignment { get; set; }
Property Value
| Type | Description |
|---|---|
| PdfVerticalAlignment |
Methods
ClearImage()
Clears any image from this cell.
Declaration
public void ClearImage()
SetImage(PdfImage, PdfSize?)
Sets an image in this cell.
Declaration
public TableCell SetImage(PdfImage image, PdfSize? size = null)
Parameters
| Type | Name | Description |
|---|---|---|
| PdfImage | image | The image to set. |
| PdfSize? | size | Optional size override. If null, uses the image's native size. |
Returns
| Type | Description |
|---|---|
| TableCell | This cell for method chaining. |