TableCell Class
Represents a single cell in a table row, which contains the table's content.
public sealed class TableCell : Element, IContentElement
Public NotInheritable Class TableCell
Inherits Element
Implements IContentElement
- Inheritance:
- System.ObjectTableCell
Implements
Remarks
TableCell is a content Element consisting of Block derived elements (Paragraphs and Tables).
TableCell can be formatted using the CellFormat property.
TableCell can be spanned through multiple rows and columns with RowSpan and ColumnSpan properties.
For more information, see table examples.
Constructors
TableCell(DocumentModel)
Initializes a new instance of the TableCell class.
Parameters
document
- DocumentModel
The owner document.
TableCell(DocumentModel, Block[])
public TableCell(DocumentModel document, params Block[] blocks)
Public Sub New(document As DocumentModel, ParamArray blocks As Block())
Parameters
document
- DocumentModel
The owner document.
blocks
- Block[]
The cell content.
TableCell(DocumentModel, IEnumerable<Block>)
public TableCell(DocumentModel document, IEnumerable<Block> blocks)
Public Sub New(document As DocumentModel, blocks As IEnumerable(Of Block))
Parameters
document
- DocumentModel
The owner document.
blocks
- System.Collections.Generic.IEnumerable<Block>
The cell content.
TableCell(DocumentModel, String)
Initializes a new instance of the TableCell class with specified text.
public TableCell(DocumentModel document, string text)
Public Sub New(document As DocumentModel, text As String)
Parameters
document
- DocumentModel
The owner document.
text
- System.String
The cell text.
Properties
Blocks
Gets the block elements that represent content of this TableCell instance.
Property Value
The block elements that represent content of this TableCell instance.
Remarks
Supports all Block derived elements: Paragraph, Table and TableOfEntries.
CellFormat
Gets or sets the table cell format.
public TableCellFormat CellFormat { get; set; }
Public Property CellFormat As TableCellFormat
Property Value
The table cell format.
CellFormatRevision
Gets or sets the revision of the cell format of this table cell. This property contains the cell format which was applied to this cell before the revision.
public TableCellFormatRevision CellFormatRevision { get; set; }
Public Property CellFormatRevision As TableCellFormatRevision
Property Value
The revision of the cell format of this table cell.
Remarks
The revision is internally stored as a member of CellFormat. Using set property on CellFormat overrides this revision.
ColumnSpan
Gets or sets the column span.
Property Value
- System.Int32
The column span.
Remarks
Default value is 1.
Document
Gets the owner document.
public override DocumentModel Document { get; }
Public Overrides ReadOnly Property Document As DocumentModel
Property Value
The owner document.
Overrides
ElementType
Gets the ElementType of this Element instance.
public override ElementType ElementType { get; }
Public Overrides ReadOnly Property ElementType As ElementType
Property Value
The ElementType of this Element instance.
Overrides
Parent
Property Value
ParentCollection
Gets the TableCellCollection that contains this TableCell instance.
public TableCellCollection ParentCollection { get; }
Public ReadOnly Property ParentCollection As TableCellCollection
Property Value
The TableCellCollection that contains this TableCell instance.
Revision
Gets or sets the revision information for the table cell.
Property Value
The revision information for the table cell.
Remarks
The revision is internally stored as a member of CellFormat. Using set property on CellFormat overrides this revision.
RowSpan
Gets or sets the row span.
Property Value
- System.Int32
The row span.
Remarks
Default value is 1.
Methods
Clone(Boolean)
Clones this TableCell instance.
public TableCell Clone(bool cloneDescendants)
Public Function Clone(cloneDescendants As Boolean) As TableCell
Parameters
cloneDescendants
- System.Boolean
If set to true clone all descendants recursively; otherwise clone only current TableCell.
Returns
Remarks
Document content element instance can exist only in a one place in the document.
If you want to insert document content element into some other part of the same document, then clone the element and insert its clone.
If you want to insert document content element into another document, then you should first import it into another document with Import<T>(T, Boolean, Boolean) method and then insert the imported element.
For more information, see cloning example.
Inherited Properties
Content | Gets the content of the current Element. (Inherited from Element) |
Inherited Methods
GetChildElements(System.Boolean) | Gets the child elements. (Inherited from Element) |
GetChildElements(System.Boolean, ElementType[]) | Gets the child elements filtered by ElementType. (Inherited from Element) |
GetParentElements() | Gets the parent elements. (Inherited from Element) |
GetParentElements(ElementType[]) | Gets the parent elements. (Inherited from Element) |