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

    Show / Hide Table of Contents

    Table Class

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

    Represents a set of paragraphs (and other Block-level content) arranged in rows and columns.

    • C#
    • VB.NET
    public sealed class Table : Block, IContentElement
    Public NotInheritable Class Table
        Inherits Block
        Implements IContentElement
    Inheritance:
    System.Object
    Element
    Block
    Table
    Implements
    IContentElement
    Remarks

    Table is a Block derived content element consisting of TableRows.

    Table can be formatted using the TableFormat property.

    Default width for table columns can be specified with Columns property.

    For more information, see table examples.

    Constructors

    Table(DocumentModel)

    Initializes a new instance of the Table class.

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

    The owner document.

    Table(DocumentModel, TableRow[])

    Initializes a new instance of the Table class with specified rows.

    • C#
    • VB.NET
    public Table(DocumentModel document, params TableRow[] rows)
    Public Sub New(document As DocumentModel, ParamArray rows As TableRow())
    Parameters
    document
    DocumentModel

    The owner document.

    rows
    TableRow[]

    The table rows.

    Table(DocumentModel, IEnumerable<TableRow>)

    Initializes a new instance of the Table class with specified rows.

    • C#
    • VB.NET
    public Table(DocumentModel document, IEnumerable<TableRow> rows)
    Public Sub New(document As DocumentModel, rows As IEnumerable(Of TableRow))
    Parameters
    document
    DocumentModel

    The owner document.

    rows
    System.Collections.Generic.IEnumerable<TableRow>

    The table rows.

    Table(DocumentModel, Int32, Int32)

    Initializes a new instance of the Table class with a specified row and column count.

    • C#
    • VB.NET
    public Table(DocumentModel document, int rowCount, int columnCount)
    Public Sub New(document As DocumentModel, rowCount As Integer, columnCount As Integer)
    Parameters
    document
    DocumentModel

    The owner document.

    rowCount
    System.Int32

    The row count.

    columnCount
    System.Int32

    The column count.

    Table(DocumentModel, Int32, Int32, CreateTableCell)

    Initializes a new instance of the Table class with a specified number of row and column count and a method used to create TableCells.

    • C#
    • VB.NET
    public Table(DocumentModel document, int rowCount, int columnCount, CreateTableCell tableCellCreator)
    Public Sub New(document As DocumentModel, rowCount As Integer, columnCount As Integer, tableCellCreator As CreateTableCell)
    Parameters
    document
    DocumentModel

    The owner document.

    rowCount
    System.Int32

    The row count.

    columnCount
    System.Int32

    The column count.

    tableCellCreator
    CreateTableCell

    The table cell creator.

    Properties

    Columns

    Gets the table columns.

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

    The table columns.

    Remarks

    This collection does not reflect the structure of a Table (how many TableCells are in each TableRow), it is used just to specify a width for all TableCells that are contained in the specific table column through PreferredWidth.

    See Also
    TableColumn

    ColumnsRevision

    Gets or sets the revision of the table grid. This property contains the columns and their widths before this revision

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

    The revision of the table grid.

    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

    Metadata

    Gets the metadata (non-visual properties) of this Table instance.

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

    The metadata (non-visual properties) of this Table instance.

    Rows

    Gets the table rows.

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

    The table rows.

    Remarks

    Since TableRow class is sealed, only supported element in this collection is TableRow.

    TableFormat

    Gets or sets the table format.

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

    The table format.

    TableFormatRevision

    Gets or sets the revision of the format of this table. This property contains the format which was applied to this table before the revision.

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

    The revision of the format of this table.

    Remarks

    The revision is internally stored as a member of TableFormat. Using set property on TableFormat overrides this revision.

    Methods

    Clone(Boolean)

    Clones this Table instance.

    • C#
    • VB.NET
    public Table Clone(bool cloneDescendants)
    Public Function Clone(cloneDescendants As Boolean) As Table
    Parameters
    cloneDescendants
    System.Boolean

    If set to true clone all descendants recursively; otherwise clone only current Table.

    Returns
    Table

    Cloned Table.

    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)

    Parent

    Gets the parent of this Element instance.

    (Inherited from Element)

    ParentCollection

    Gets the BlockCollection that contains this Block instance.

    (Inherited from Block)

    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.