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

    Show / Hide Table of Contents

    TableFormat Class

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

    Represents a set of table-wide properties. These properties affect the appearance of all rows and cells within the parent table, but may be overridden by individual row and cell level formats.

    • C#
    • VB.NET
    public sealed class TableFormat : Format
    Public NotInheritable Class TableFormat
        Inherits Format
    Inheritance:
    System.Object
    Format
    TableFormat

    Constructors

    TableFormat()

    Initializes a new instance of the TableFormat class.

    • C#
    • VB.NET
    public TableFormat()
    Public Sub New

    Properties

    Alignment

    Gets or sets the alignment of the table with respect to the text margins in the section.

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

    The alignment of the table with respect to the text margins in the section.

    Remarks

    Only Left, Center and Right values are supported.

    AutomaticallyResizeToFitContents

    Gets or sets a value indicating whether the table shall automatically resize to fit contents.

    • C#
    • VB.NET
    public bool AutomaticallyResizeToFitContents { get; set; }
    Public Property AutomaticallyResizeToFitContents As Boolean
    Property Value
    System.Boolean

    true if the table shall automatically resize to fit contents; otherwise, false.

    BackgroundColor

    Gets or sets the table background color.

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

    The table background color.

    Borders

    Gets the table borders.

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

    The table borders.

    ColumnBandSize

    Gets or sets the number of columns in column band for this table style.

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

    The number of columns in column band for this table style.

    Remarks

    Column banding is a grouping of columns into two successively alternating groups (odd and even).

    ColumnBandSize specifies the size of the group. Each group (odd and even) can have its own table style conditional formatting specified.

    For more information about table styles, see table styles article and table styles example.

    Exceptions
    System.ArgumentOutOfRangeException

    Column banding size must be equal or greater than zero.

    DefaultCellPadding

    Gets or sets the default table cell padding.

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

    The default table cell padding.

    DefaultCellSpacing

    Gets or sets the default table cell spacing (the spacing between adjacent cells and the edges of the table) for all cells in the parent table.

    • C#
    • VB.NET
    public double DefaultCellSpacing { get; set; }
    Public Property DefaultCellSpacing As Double
    Property Value
    System.Double

    The default table cell spacing (the spacing between adjacent cells and the edges of the table) for all cells in the parent table.

    IndentFromLeft

    Gets or sets the indentation that should shift the table into the text margin by the specified amount.

    • C#
    • VB.NET
    public double IndentFromLeft { get; set; }
    Public Property IndentFromLeft As Double
    Property Value
    System.Double

    The indentation that should shift the table into the text margin by the specified amount.

    Positioning

    Gets the floating table positioning settings.

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

    The floating table positioning settings.

    PreferredWidth

    Gets or sets the table preferred width.

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

    The table preferred width.

    RightToLeft

    Gets or sets a value indicating whether the cells in this table shall be visually represented in a right to left direction.

    • C#
    • VB.NET
    public bool RightToLeft { get; set; }
    Public Property RightToLeft As Boolean
    Property Value
    System.Boolean

    true if the cells in this table shall be visually represented in a right to left direction; otherwise, false.

    Remarks

    When this property is specified, then the ordering of all cells (and table-level properties) in this table shall be applied to the table assuming that the table is a normal left to right table, but the table cells shall be displayed in a right to left direction. Example: A left border on the first table cell must be displayed on the right side of that cell (which would be the rightmost cell) in a visually right to left table.

    RowBandSize

    Gets or sets the number of rows in row band for this table style.

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

    The number of rows in row band for this table style.

    Remarks

    Row banding is a grouping of rows into two successively alternating groups (odd and even).

    RowBandSize specifies the size of the group. Each group (odd and even) can have its own table style conditional formatting specified.

    For more information about table styles, see table styles article and table styles example.

    Exceptions
    System.ArgumentOutOfRangeException

    Row banding size must be equal or greater than zero.

    Style

    Gets or sets the table style.

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

    The table style.

    Remarks

    For more information about table styles, see table styles article and table styles example.

    StyleOptions

    Gets or sets the table style options that specify which of the referenced TableStyle conditional formats will be applied on the parent Table.

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

    The table style options that specify which of the referenced TableStyle conditional formats will be applied on the parent Table.

    Remarks

    For more information about table styles, see table styles article and table styles example.

    Methods

    ClearFormatting()

    Clears the formatting.

    • C#
    • VB.NET
    public override void ClearFormatting()
    Public Overrides Sub ClearFormatting
    Overrides
    Format.ClearFormatting()
    Remarks

    This method will clear all directly set formatting values. When retrieving formatting value, they can still come from other sources, as explained in formats and styles article.

    Clone()

    Clones this TableFormat instance.

    • C#
    • VB.NET
    public TableFormat Clone()
    Public Function Clone As TableFormat
    Returns
    TableFormat

    Cloned TableFormat.

    Clone(Boolean)

    Clones this TableFormat instance.

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

    If true, the values to be cloned will be fetched from this object's resolved values. This means that even if a property was never explicitly set, this method will look into this format style or in the document's default formats to resolve the values and explicitly set them in the cloned object.

    Returns
    TableFormat

    Cloned TableFormat.

    Equals(Object)

    Determines whether the specified System.Object is equal to this TableFormat instance.

    • C#
    • VB.NET
    public override bool Equals(object obj)
    Public Overrides Function Equals(obj As Object) As Boolean
    Parameters
    obj
    System.Object

    The System.Object to compare with this table format instance.

    Returns
    System.Boolean

    true if the specified System.Object is a TableFormat and is equal to this TableFormat instance; otherwise, false.

    Overrides
    System.Object.Equals(System.Object)

    GetHashCode()

    Returns a hash code for this TableFormat instance.

    • C#
    • VB.NET
    public override int GetHashCode()
    Public Overrides Function GetHashCode As Integer
    Returns
    System.Int32

    An integer value that specifies a hash value for this TableFormat instance.

    Overrides
    System.Object.GetHashCode()

    Operators

    Equality(TableFormat, TableFormat)

    Determines whether first and second TableFormats are equal.

    • C#
    • VB.NET
    public static bool operator ==(TableFormat first, TableFormat second)
    Public Shared Operator =(first As TableFormat, second As TableFormat) As Boolean
    Parameters
    first
    TableFormat

    The first table format.

    second
    TableFormat

    The second table format.

    Returns
    System.Boolean

    true if first and second table formats are equal; otherwise, false.

    Inequality(TableFormat, TableFormat)

    Determines whether first and second TableFormats are not equal.

    • C#
    • VB.NET
    public static bool operator !=(TableFormat first, TableFormat second)
    Public Shared Operator <>(first As TableFormat, second As TableFormat) As Boolean
    Parameters
    first
    TableFormat

    The first table format.

    second
    TableFormat

    The second table format.

    Returns
    System.Boolean

    true if first and second table formats are not equal; otherwise, false.

    Inherited Properties

    Document

    Gets the owner document.

    (Inherited from Format)

    Examples

    Table Formatting example
    Table styles example
    Back to top

    Facebook • Twitter • LinkedIn

    © GemBox Ltd. — All rights reserved.