GemBox.Document
  • Overview
  • Examples
  • Free version
  • Support
  • Pricelist

    Show / Hide Table of Contents

    TableCell Class

    Namespace:
    GemBox.Document.Tables
    Assembly:
    GemBox.Document.dll

    Represents a single cell in a table row, which contains the table's content.

    • C#
    • VB.NET
    public sealed class TableCell : Element, IContentElement
    Public NotInheritable Class TableCell
        Inherits Element
        Implements IContentElement
    Inheritance:
    System.Object
    Element
    TableCell
    Implements
    IContentElement
    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.

    • C#
    • VB.NET
    public TableCell(DocumentModel document)
    Public Sub New(document As DocumentModel)
    Parameters
    document
    DocumentModel

    The owner document.

    TableCell(DocumentModel, Block[])

    Initializes a new instance of the TableCell class with a specified content (Paragraphs or Tables).

    • C#
    • VB.NET
    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>)

    Initializes a new instance of the TableCell class with a specified content (Paragraphs or Tables).

    • C#
    • VB.NET
    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.

    • C#
    • VB.NET
    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.

    • C#
    • VB.NET
    public BlockCollection Blocks { get; }
    Public ReadOnly Property Blocks As BlockCollection
    Property Value
    BlockCollection

    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.

    • C#
    • VB.NET
    public TableCellFormat CellFormat { get; set; }
    Public Property CellFormat As TableCellFormat
    Property Value
    TableCellFormat

    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.

    • C#
    • VB.NET
    public TableCellFormatRevision CellFormatRevision { get; set; }
    Public Property CellFormatRevision As TableCellFormatRevision
    Property Value
    TableCellFormatRevision

    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.

    • C#
    • VB.NET
    public int ColumnSpan { get; set; }
    Public Property ColumnSpan As Integer
    Property Value
    System.Int32

    The column span.

    Remarks

    Default value is 1.

    Document

    Gets the owner document.

    • C#
    • VB.NET
    public override DocumentModel Document { get; }
    Public Overrides ReadOnly Property Document As DocumentModel
    Property Value
    DocumentModel

    The owner document.

    Overrides
    Element.Document

    ElementType

    Gets the ElementType of this Element instance.

    • C#
    • VB.NET
    public override ElementType ElementType { get; }
    Public Overrides ReadOnly Property ElementType As ElementType
    Property Value
    ElementType

    The ElementType of this Element instance.

    Overrides
    Element.ElementType

    Parent

    Gets the parent TableRow of this TableCell instance.

    • C#
    • VB.NET
    public TableRow Parent { get; }
    Public ReadOnly Property Parent As TableRow
    Property Value
    TableRow

    The parent TableRow of this TableCell instance.

    ParentCollection

    Gets the TableCellCollection that contains this TableCell instance.

    • C#
    • VB.NET
    public TableCellCollection ParentCollection { get; }
    Public ReadOnly Property ParentCollection As TableCellCollection
    Property Value
    TableCellCollection

    The TableCellCollection that contains this TableCell instance.

    Revision

    Gets or sets the revision information for the table cell.

    • C#
    • VB.NET
    public Revision Revision { get; set; }
    Public Property Revision As Revision
    Property Value
    Revision

    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.

    • C#
    • VB.NET
    public int RowSpan { get; set; }
    Public Property RowSpan As Integer
    Property Value
    System.Int32

    The row span.

    Remarks

    Default value is 1.

    Methods

    Clone(Boolean)

    Clones this TableCell instance.

    • C#
    • VB.NET
    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
    TableCell

    Cloned TableCell.

    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)

    Implements

    IContentElement
    Back to top

    Facebook • Twitter • LinkedIn

    © GemBox Ltd. — All rights reserved.