Table of Contents

Class Cell

Namespace
iText.Layout.Element
Assembly
itext.layout.dll

A Cell is one piece of data in an enclosing grid, the Table.

public class Cell : BlockElement<Cell>, IAccessibleElement, IBlockElement, IAbstractElement, IElement, IPropertyContainer
Inheritance
Cell
Implements
Inherited Members

Remarks

A Cell is one piece of data in an enclosing grid, the Table. This object is a BlockElement<T> , giving it a number of visual layout properties. A cell can act as a container for a number of layout elements; it can only contain other BlockElement<T> objects or images. Other types of layout elements must be wrapped in a BlockElement<T>.

Constructors

Cell()

Creates a cell.

public Cell()

Cell(int, int)

Creates a cell which takes a custom amount of cell spaces in the table.

public Cell(int rowspan, int colspan)

Parameters

rowspan int

the number of rows this cell must occupy. Negative numbers will make the argument default to 1.

colspan int

the number of columns this cell must occupy. Negative numbers will make the argument default to 1.

Fields

tagProperties

protected DefaultAccessibilityProperties tagProperties

Field Value

DefaultAccessibilityProperties

Methods

Add(IBlockElement)

Adds any block element to the cell's contents.

public virtual Cell Add(IBlockElement element)

Parameters

element IBlockElement

a BlockElement<T>

Returns

Cell

this Element

Add(Image)

Adds an image to the cell's contents.

public virtual Cell Add(Image element)

Parameters

element Image

an Image

Returns

Cell

this Element

Clone(bool)

Clones a cell with its position, properties, and optionally its contents.

public virtual Cell Clone(bool includeContent)

Parameters

includeContent bool

whether or not to also include the contents of the cell.

Returns

Cell

a clone of this Element

GetAccessibilityProperties()

public override AccessibilityProperties GetAccessibilityProperties()

Returns

AccessibilityProperties

GetCol()

Gets the number of the column in which the cell is located.

public virtual int GetCol()

Returns

int

the column number

GetColspan()

Gets the colspan of the cell.

public virtual int GetColspan()

Returns

int

the colspan

GetDefaultProperty<T1>(int)

public override T1 GetDefaultProperty<T1>(int property)

Parameters

property int

Returns

T1

Type Parameters

T1

GetRenderer()

Gets a cell renderer for this element.

public override IRenderer GetRenderer()

Returns

IRenderer

a cell renderer for this element

Remarks

Gets a cell renderer for this element. Note that this method can be called more than once. By default each element should define its own renderer, but the renderer can be overridden by SetNextRenderer(IRenderer) method call.

GetRow()

Gets the number of the row in which the cell is located.

public virtual int GetRow()

Returns

int

the row number

GetRowspan()

Gets the rowspan of the cell.

public virtual int GetRowspan()

Returns

int

the rowspan

MakeNewRenderer()

protected override IRenderer MakeNewRenderer()

Returns

IRenderer

ToString()

public override string ToString()

Returns

string

UpdateCellIndexes(int, int, int)

Updates cell indexes.

protected virtual Cell UpdateCellIndexes(int row, int col, int numberOfColumns)

Parameters

row int

the number of the row to update

col int

the number of the col to update

numberOfColumns int

to evaluate new colspan

Returns

Cell

this Cell with updated fields