TableFormat Class
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.
public sealed class TableFormat : Format
Public NotInheritable Class TableFormat
Inherits Format
- Inheritance:
- System.ObjectTableFormat
Constructors
TableFormat()
Initializes a new instance of the TableFormat class.
Properties
Alignment
Gets or sets the alignment of the table with respect to the text margins in the section.
public HorizontalAlignment Alignment { get; set; }
Public Property Alignment As HorizontalAlignment
Property Value
The alignment of the table with respect to the text margins in the section.
Remarks
AutomaticallyResizeToFitContents
Gets or sets a value indicating whether the table shall automatically resize to fit contents.
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.
Property Value
The table background color.
Borders
Gets the table borders.
Property Value
The table borders.
ColumnBandSize
Gets or sets the number of columns in column band for this table style.
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.
public Padding DefaultCellPadding { get; set; }
Public Property DefaultCellPadding As Padding
Property Value
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.
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.
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.
public TablePositioning Positioning { get; }
Public ReadOnly Property Positioning As TablePositioning
Property Value
The floating table positioning settings.
PreferredWidth
Gets or sets the table preferred width.
Property Value
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.
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.
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.
Property Value
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.
public TableStyleOptions StyleOptions { get; set; }
Public Property StyleOptions As TableStyleOptions
Property Value
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.
Overrides
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.
Returns
Cloned TableFormat.
Clone(Boolean)
Clones this TableFormat instance.
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
Cloned TableFormat.
Equals(Object)
Determines whether the specified System.Object is equal to this TableFormat instance.
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
GetHashCode()
Returns a hash code for this TableFormat instance.
Returns
- System.Int32
An integer value that specifies a hash value for this TableFormat instance.
Overrides
Operators
Equality(TableFormat, TableFormat)
Determines whether first
and second
TableFormats are equal.
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.
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) |