iText 8.0.5 API
iText.Layout.Element.Table Class Reference

A Table is a layout element that represents data in a two-dimensional grid. More...

Inheritance diagram for iText.Layout.Element.Table:
iText.Layout.Element.BlockElement< iText.Layout.Element.Table > iText.Layout.Element.ILargeElement iText.Layout.Element.IElement iText.Layout.IPropertyContainer

Classes

class   RowRange
  A simple object which holds the row numbers of a section of a table. More...
 

Public Member Functions

  Table (float[] columnWidths, bool largeTable)
  Constructs a Table with the preferable column widths. More...
 
  Table (UnitValue[] columnWidths, bool largeTable)
  Constructs a Table with the preferable column widths. More...
 
  Table (UnitValue[] columnWidths)
  Constructs a Table with the preferable column widths. More...
 
  Table (float[] pointColumnWidths)
  Constructs a Table with the preferable column widths. More...
 
  Table (int numColumns, bool largeTable)
  Constructs a Table with specified number of columns. More...
 
  Table (int numColumns)
  Constructs a Table with specified number of columns. More...
 
virtual iText.Layout.Element.Table  SetFixedLayout ()
  Set fixed layout. More...
 
virtual iText.Layout.Element.Table  SetAutoLayout ()
  Set auto layout. More...
 
virtual iText.Layout.Element.Table  UseAllAvailableWidth ()
  Set iText.Layout.Properties.Property.WIDTH = 100%. More...
 
virtual UnitValue  GetColumnWidth (int column)
  Returns the column width for the specified column. More...
 
virtual int  GetNumberOfColumns ()
  Returns the number of columns. More...
 
virtual int  GetNumberOfRows ()
  Returns the number of rows. More...
 
virtual iText.Layout.Element.Table  AddHeaderCell (Cell headerCell)
  Adds a new cell to the header of the table. More...
 
virtual iText.Layout.Element.Table  AddHeaderCell< T > (BlockElement< T > blockElement)
  Adds a new cell with received blockElement as a content to the header of the table. More...
 
virtual iText.Layout.Element.Table  AddHeaderCell (Image image)
  Adds a new cell with received image to the header of the table. More...
 
virtual iText.Layout.Element.Table  AddHeaderCell (String content)
  Adds a new cell with received string as a content to the header of the table. More...
 
virtual iText.Layout.Element.Table  GetHeader ()
  Gets the header of the table. More...
 
virtual iText.Layout.Element.Table  AddFooterCell (Cell footerCell)
  Adds a new cell to the footer of the table. More...
 
virtual iText.Layout.Element.Table  AddFooterCell< T > (BlockElement< T > blockElement)
  Adds a new cell with received blockElement as a content to the footer of the table. More...
 
virtual iText.Layout.Element.Table  AddFooterCell (Image image)
  Adds a new cell with received image as a content to the footer of the table. More...
 
virtual iText.Layout.Element.Table  AddFooterCell (String content)
  Adds a new cell with received string as a content to the footer of the table. More...
 
virtual iText.Layout.Element.Table  GetFooter ()
  Gets the footer of the table. More...
 
virtual bool  IsSkipFirstHeader ()
  Tells you if the first header needs to be skipped (for instance if the header says "continued from the previous page"). More...
 
virtual iText.Layout.Element.Table  SetSkipFirstHeader (bool skipFirstHeader)
  Skips the printing of the first header. More...
 
virtual bool  IsSkipLastFooter ()
  Tells you if the last footer needs to be skipped (for instance if the footer says "continued on the next page") More...
 
virtual iText.Layout.Element.Table  SetSkipLastFooter (bool skipLastFooter)
  Skips the printing of the last footer. More...
 
virtual iText.Layout.Element.Table  SetCaption (Div caption)
  Sets the table's caption. More...
 
virtual iText.Layout.Element.Table  SetCaption (Div caption, CaptionSide side)
  Sets the table's caption and its caption side. More...
 
virtual Div  GetCaption ()
  Gets the table's caption. More...
 
virtual iText.Layout.Element.Table  StartNewRow ()
  Starts new row. More...
 
virtual iText.Layout.Element.Table  AddCell (Cell cell)
  Adds a new cell to the table. More...
 
virtual iText.Layout.Element.Table  AddCell< T > (BlockElement< T > blockElement)
  Adds a new cell with received blockElement as a content. More...
 
virtual iText.Layout.Element.Table  AddCell (Image image)
  Adds a new cell with received image as a content. More...
 
virtual iText.Layout.Element.Table  AddCell (String content)
  Adds a new cell with received string as a content. More...
 
virtual Cell  GetCell (int row, int column)
  Returns a cell as specified by its location. More...
 
override IRenderer  CreateRendererSubTree ()
  Creates a renderer subtree with root in the current table element. More...
 
override IRenderer  GetRenderer ()
  Gets a table renderer for this element. More...
 
virtual bool  IsComplete ()
  Checks whether an element has already been marked as complete. More...
 
virtual void  Complete ()
  Indicates that all the desired content has been added to this large element and no more content will be added. More...
 
virtual void  Flush ()
  Writes the newly added content to the document. More...
 
virtual void  FlushContent ()
  Flushes the content which has just been added to the document. More...
 
virtual void  SetDocument (Document document)
  Sets the document this element is bound to. More...
 
virtual IList< Border GetLastRowBottomBorder ()
  Gets the markup properties of the bottom border of the (current) last row. More...
 
virtual iText.Layout.Element.Table  SetExtendBottomRow (bool isExtended)
  Defines whether the Table should be extended to occupy all the space left in the available area in case it is the last element in this area. More...
 
virtual iText.Layout.Element.Table  SetExtendBottomRowOnSplit (bool isExtended)
  Defines whether the Table should be extended to occupy all the space left in the available area in case the area has been split and it is the last element in the split part of this area. More...
 
virtual iText.Layout.Element.Table  SetBorderCollapse (BorderCollapsePropertyValue collapsePropertyValue)
  Sets the type of border collapse. More...
 
virtual iText.Layout.Element.Table  SetHorizontalBorderSpacing (float spacing)
  Sets the horizontal spacing between this table 's cells. More...
 
virtual iText.Layout.Element.Table  SetVerticalBorderSpacing (float spacing)
  Sets the vertical spacing between this table 's cells. More...
 
override AccessibilityProperties  GetAccessibilityProperties ()
  Gets the accessibility properties. More...
 
- Public Member Functions inherited from iText.Layout.Element.BlockElement< iText.Layout.Element.Table >
override T1  GetDefaultProperty< T1 > (int property)
  Gets the default property from this entity. More...
 
virtual UnitValue  GetMarginLeft ()
  Gets the current left margin width of the element. More...
 
virtual T  SetMarginLeft (float value)
  Sets the left margin width of the element. More...
 
virtual UnitValue  GetMarginRight ()
  Gets the current right margin width of the element. More...
 
virtual T  SetMarginRight (float value)
  Sets the right margin width of the element. More...
 
virtual UnitValue  GetMarginTop ()
  Gets the current top margin width of the element. More...
 
virtual T  SetMarginTop (float value)
  Sets the top margin width of the element. More...
 
virtual UnitValue  GetMarginBottom ()
  Gets the current bottom margin width of the element. More...
 
virtual T  SetMarginBottom (float value)
  Sets the bottom margin width of the element. More...
 
virtual T  SetMargin (float commonMargin)
  Sets all margins around the element to the same width. More...
 
virtual T  SetMargins (float marginTop, float marginRight, float marginBottom, float marginLeft)
  Sets the margins around the element to a series of new widths. More...
 
virtual UnitValue  GetPaddingLeft ()
  Gets the current left padding width of the element. More...
 
virtual T  SetPaddingLeft (float value)
  Sets the left padding width of the element. More...
 
virtual UnitValue  GetPaddingRight ()
  Gets the current right padding width of the element. More...
 
virtual T  SetPaddingRight (float value)
  Sets the right padding width of the element. More...
 
virtual UnitValue  GetPaddingTop ()
  Gets the current top padding width of the element. More...
 
virtual T  SetPaddingTop (float value)
  Sets the top padding width of the element. More...
 
virtual UnitValue  GetPaddingBottom ()
  Gets the current bottom padding width of the element. More...
 
virtual T  SetPaddingBottom (float value)
  Sets the bottom padding width of the element. More...
 
virtual T  SetPadding (float commonPadding)
  Sets all paddings around the element to the same width. More...
 
virtual T  SetPaddings (float paddingTop, float paddingRight, float paddingBottom, float paddingLeft)
  Sets the paddings around the element to a series of new widths. More...
 
virtual T  SetVerticalAlignment (VerticalAlignment? verticalAlignment)
  Sets the vertical alignment of the element. More...
 
virtual T  SetSpacingRatio (float ratio)
  Sets a ratio which determines in which proportion will word spacing and character spacing be applied when horizontal alignment is justified. More...
 
virtual ? bool  IsKeepTogether ()
  Returns whether the BlockElement should be kept together as much as possible. More...
 
virtual T  SetKeepTogether (bool keepTogether)
  Sets whether the BlockElement should be kept together as much as possible. More...
 
virtual ? bool  IsKeepWithNext ()
  Returns whether the end of this BlockElement and the start of the next sibling of this element should be placed in the same area. More...
 
virtual T  SetKeepWithNext (bool keepWithNext)
  Sets whether the end of this BlockElement and the start of the next sibling of this element should be placed in the same area. More...
 
virtual T  SetRotationAngle (float angleInRadians)
  Sets the rotation radAngle. More...
 
virtual T  SetRotationAngle (double angleInRadians)
  Sets the rotation angle. More...
 
virtual T  SetWidth (float width)
  Sets the width property of a block element, measured in points. More...
 
virtual T  SetWidth (UnitValue width)
  Sets the width property of a block element with a iText.Layout.Properties.UnitValue. More...
 
virtual UnitValue  GetWidth ()
  Gets the width property of a block element. More...
 
virtual T  SetHeight (UnitValue height)
  Sets the height property of a block element with a iText.Layout.Properties.UnitValue. More...
 
virtual T  SetHeight (float height)
  Sets the height property a block element as a point-value. More...
 
virtual UnitValue  GetHeight ()
  Gets the height property of a block element. More...
 
virtual T  SetMaxHeight (float maxHeight)
  Sets the max-height of a block element as point-unit value. More...
 
virtual T  SetMaxHeight (UnitValue maxHeight)
  Sets the max-height property of a block element with a iText.Layout.Properties.UnitValue. More...
 
virtual T  SetMinHeight (UnitValue minHeight)
  Sets the min-height property of a block element with a iText.Layout.Properties.UnitValue. More...
 
virtual T  SetMinHeight (float minHeight)
  Sets the min-height of a block element as point-unit value. More...
 
virtual T  SetMaxWidth (UnitValue maxWidth)
  Sets the max-width property of a block element with a iText.Layout.Properties.UnitValue. More...
 
virtual T  SetMaxWidth (float maxWidth)
  Sets the max-width of a block element as point-unit value. More...
 
virtual T  SetMinWidth (UnitValue minWidth)
  Sets the min-width property of a block element with a iText.Layout.Properties.UnitValue. More...
 
virtual T  SetMinWidth (float minWidth)
  Sets the min-width of a block element as point-unit value. More...
 
virtual T  SetNeutralRole ()
  Give this element a neutral role. More...
 
- Public Member Functions inherited from iText.Layout.Element.IElement
void  SetNextRenderer (IRenderer renderer)
  Overrides the iText.Layout.Renderer.IRenderer instance which will be returned by the next call to the GetRenderer(). More...
 
- Public Member Functions inherited from iText.Layout.IPropertyContainer
bool  HasProperty (int property)
  Checks if this entity has the specified property. More...
 
bool  HasOwnProperty (int property)
  Checks if this entity has the specified property, i.e. if it was set to this very element earlier More...
 
T1  GetProperty< T1 > (int property)
  Gets the property from this entity. More...
 
T1  GetOwnProperty< T1 > (int property)
  Gets own property from this entity. More...
 
T1  GetDefaultProperty< T1 > (int property)
  Gets the default property from this entity. More...
 
void  SetProperty (int property, Object value)
  Sets a property for this entity. More...
 
void  DeleteOwnProperty (int property)
  Deletes the own property of this entity. More...
 

Package Functions

override IRenderer  MakeNewRenderer ()
 
virtual IList< Table.RowRange GetRowGroups ()
  Returns the list of all row groups. More...
 
- Package Functions inherited from iText.Layout.Element.BlockElement< iText.Layout.Element.Table >
  BlockElement ()
  Creates a BlockElement. More...
 

Package Attributes

DefaultAccessibilityProperties  tagProperties
 

Detailed Description

A Table is a layout element that represents data in a two-dimensional grid.

A Table is a layout element that represents data in a two-dimensional grid. It is filled with cells , ordered in rows and columns.

It is an implementation of ILargeElement , which means it can be flushed to the canvas, in order to reclaim memory that is locked up.

Constructor & Destructor Documentation

◆ Table() [1/6]

iText.Layout.Element.Table.Table ( float[]  columnWidths,
bool  largeTable 
)
inline

Constructs a Table with the preferable column widths.

Constructs a Table with the preferable column widths.
Since 7.0.2 table layout algorithms were introduced. Auto layout is default, except large tables. For large table 100% width and fixed layout set implicitly.
Note, the eventual columns width depends on selected layout, table width, cell's width, cell's min-widths, and cell's max-widths. Table layout algorithm has the same behaviour as expected for CSS table-layout property, where columnWidths is 's widths. For more information see SetAutoLayout() and SetFixedLayout().

Parameters
columnWidths preferable column widths in points. Values must be greater than or equal to zero, otherwise it will be interpreted as undefined.
largeTable whether parts of the table will be written before all data is added. Note, large table does not support auto layout, table width shall not be removed.
See also
SetAutoLayout(), SetFixedLayout()

◆ Table() [2/6]

iText.Layout.Element.Table.Table ( UnitValue[]  columnWidths,
bool  largeTable 
)
inline

Constructs a Table with the preferable column widths.

Constructs a Table with the preferable column widths.
Since 7.0.2 table layout algorithms were introduced. Auto layout is default, except large tables. For large table 100% width and fixed layout set implicitly.
Note, the eventual columns width depends on selected layout, table width, cell's width, cell's min-widths, and cell's max-widths. Table layout algorithm has the same behaviour as expected for CSS table-layout property, where columnWidths is 's widths. For more information see SetAutoLayout() and SetFixedLayout().

Parameters
columnWidths preferable column widths, points and/or percents. Values must be greater than or equal to zero, otherwise it will be interpreted as undefined.
largeTable whether parts of the table will be written before all data is added. Note, large table does not support auto layout, table width shall not be removed.
See also
SetAutoLayout(), SetFixedLayout()

◆ Table() [3/6]

iText.Layout.Element.Table.Table ( UnitValue[]  columnWidths )
inline

Constructs a Table with the preferable column widths.

Constructs a Table with the preferable column widths.
Since 7.0.2 table layout algorithms were introduced. Auto layout is default.
Note, the eventual columns width depends on selected layout, table width, cell's width, cell's min-widths, and cell's max-widths. Table layout algorithm has the same behaviour as expected for CSS table-layout property, where columnWidths is 's widths. For more information see SetAutoLayout() and SetFixedLayout().

Parameters
columnWidths preferable column widths, points and/or percents. Values must be greater than or equal to zero, otherwise it will be interpreted as undefined.
See also
SetAutoLayout(), SetFixedLayout()

◆ Table() [4/6]

iText.Layout.Element.Table.Table ( float[]  pointColumnWidths )
inline

Constructs a Table with the preferable column widths.

Constructs a Table with the preferable column widths.
Since 7.0.2 table layout algorithms were introduced. Auto layout is default.
Note, the eventual columns width depends on selected layout, table width, cell's width, cell's min-widths, and cell's max-widths. Table layout algorithm has the same behaviour as expected for CSS table-layout property, where columnWidths is 's widths. For more information see SetAutoLayout() and SetFixedLayout().

Parameters
pointColumnWidths preferable column widths in points. Values must be greater than or equal to zero, otherwise it will be interpreted as undefined.
See also
SetAutoLayout(), SetFixedLayout()

◆ Table() [5/6]

iText.Layout.Element.Table.Table ( int  numColumns,
bool  largeTable 
)
inline

Constructs a Table with specified number of columns.

Constructs a Table with specified number of columns. The final column widths depend on selected table layout.
Since 7.0.2 table layout algorithms were introduced. Auto layout is default, except large tables. For large table fixed layout set implicitly.
Since 7.1 table will have undefined column widths, that will be determined during layout. In oder to set equal percent width as column width, use iText.Layout.Properties.UnitValue.CreatePercentArray(int)
Note, the eventual columns width depends on selected layout, table width, cell's width, cell's min-widths, and cell's max-widths. Table layout algorithm has the same behaviour as expected for CSS table-layout property, where columnWidths is 's widths. For more information see SetAutoLayout() and SetFixedLayout().

Parameters
numColumns the number of columns, each column will have equal percent width.
largeTable whether parts of the table will be written before all data is added. Note, large table does not support auto layout, table width shall not be removed.
See also
SetAutoLayout(), SetFixedLayout()

◆ Table() [6/6]

iText.Layout.Element.Table.Table ( int  numColumns )
inline

Constructs a Table with specified number of columns.

Constructs a Table with specified number of columns. The final column widths depend on selected table layout.
Since 7.0.2 table layout was introduced. Auto layout is default, except large tables. For large table fixed layout set implicitly.

Since 7.1 table will have undefined column widths, that will be determined during layout. In oder to set equal percent width as column width, use iText.Layout.Properties.UnitValue.CreatePercentArray(int)

Note, the eventual columns width depends on selected layout, table width, cell's width, cell's min-widths, and cell's max-widths. Table layout algorithm has the same behaviour as expected for CSS table-layout property, where columnWidths is 's widths. For more information see SetAutoLayout() and SetFixedLayout().

Parameters
numColumns the number of columns, each column will have equal percent width.
See also
SetAutoLayout(), SetFixedLayout()

Member Function Documentation

◆ AddCell() [1/3]

virtual iText.Layout.Element.Table iText.Layout.Element.Table.AddCell ( Cell  cell )
inlinevirtual

Adds a new cell to the table.

Adds a new cell to the table. The implementation decides for itself which row the cell will be placed on.

Parameters
cell

Cell to add.

Returns
this element

◆ AddCell() [2/3]

virtual iText.Layout.Element.Table iText.Layout.Element.Table.AddCell ( Image  image )
inlinevirtual

Adds a new cell with received image as a content.

Parameters
image an image to add to the cell and then to the table
Returns
this element

◆ AddCell() [3/3]

virtual iText.Layout.Element.Table iText.Layout.Element.Table.AddCell ( String  content )
inlinevirtual

Adds a new cell with received string as a content.

Parameters
content a string to add to the cell and then to the table
Returns
this element

◆ AddCell< T >()

virtual iText.Layout.Element.Table iText.Layout.Element.Table.AddCell< T > ( BlockElement< T >  blockElement )
inlinevirtual

Adds a new cell with received blockElement as a content.

Parameters
blockElement a blockElement to add to the cell and then to the table
Template Parameters
T IElement instance
Returns
this element
Type Constraints
T  : IElement  

◆ AddFooterCell() [1/3]

virtual iText.Layout.Element.Table iText.Layout.Element.Table.AddFooterCell ( Cell  footerCell )
inlinevirtual

Adds a new cell to the footer of the table.

Adds a new cell to the footer of the table. The footer will be displayed in the bottom of every area of this table. See also SetSkipLastFooter(bool).

Parameters
footerCell a footer cell
Returns
this element

◆ AddFooterCell() [2/3]

virtual iText.Layout.Element.Table iText.Layout.Element.Table.AddFooterCell ( Image  image )
inlinevirtual

Adds a new cell with received image as a content to the footer of the table.

Adds a new cell with received image as a content to the footer of the table. The footer will be displayed in the bottom of every area of this table. See also SetSkipLastFooter(bool).

Parameters
image an image to be added to a footer cell
Returns
this element

◆ AddFooterCell() [3/3]

virtual iText.Layout.Element.Table iText.Layout.Element.Table.AddFooterCell ( String  content )
inlinevirtual

Adds a new cell with received string as a content to the footer of the table.

Adds a new cell with received string as a content to the footer of the table. The footer will be displayed in the bottom of every area of this table. See also SetSkipLastFooter(bool).

Parameters
content a content string to be added to a footer cell
Returns
this element

◆ AddFooterCell< T >()

virtual iText.Layout.Element.Table iText.Layout.Element.Table.AddFooterCell< T > ( BlockElement< T >  blockElement )
inlinevirtual

Adds a new cell with received blockElement as a content to the footer of the table.

Adds a new cell with received blockElement as a content to the footer of the table. The footer will be displayed in the bottom of every area of this table. See also SetSkipLastFooter(bool).

Parameters
blockElement an element to be added to a footer cell
Template Parameters
T IElement instance
Returns
this element
Type Constraints
T  : IElement  

◆ AddHeaderCell() [1/3]

virtual iText.Layout.Element.Table iText.Layout.Element.Table.AddHeaderCell ( Cell  headerCell )
inlinevirtual

Adds a new cell to the header of the table.

Adds a new cell to the header of the table. The header will be displayed in the top of every area of this table. See also SetSkipFirstHeader(bool).

Parameters
headerCell a header cell to be added
Returns
this element

◆ AddHeaderCell() [2/3]

virtual iText.Layout.Element.Table iText.Layout.Element.Table.AddHeaderCell ( Image  image )
inlinevirtual

Adds a new cell with received image to the header of the table.

Adds a new cell with received image to the header of the table. The header will be displayed in the top of every area of this table. See also SetSkipFirstHeader(bool).

Parameters
image an element to be added to a header cell
Returns
this element

◆ AddHeaderCell() [3/3]

virtual iText.Layout.Element.Table iText.Layout.Element.Table.AddHeaderCell ( String  content )
inlinevirtual

Adds a new cell with received string as a content to the header of the table.

Adds a new cell with received string as a content to the header of the table. The header will be displayed in the top of every area of this table. See also SetSkipFirstHeader(bool).

Parameters
content a string to be added to a header cell
Returns
this element

◆ AddHeaderCell< T >()

virtual iText.Layout.Element.Table iText.Layout.Element.Table.AddHeaderCell< T > ( BlockElement< T >  blockElement )
inlinevirtual

Adds a new cell with received blockElement as a content to the header of the table.

Adds a new cell with received blockElement as a content to the header of the table. The header will be displayed in the top of every area of this table. See also SetSkipFirstHeader(bool).

Parameters
blockElement an element to be added to a header cell
Template Parameters
T any IElement
Returns
this element
Type Constraints
T  : IElement  

◆ Complete()

virtual void iText.Layout.Element.Table.Complete ( )
inlinevirtual

Indicates that all the desired content has been added to this large element and no more content will be added.

Indicates that all the desired content has been added to this large element and no more content will be added. After this method is called, more precise rendering is activated. For instance, a table may have a SetSkipLastFooter(bool) method set to true, and in case of large table on Flush() we do not know if any more content will be added, so we might not place the content in the bottom of the page where it would fit, but instead add a footer, and place that content in the start of the page. Technically such result would look all right, but it would be more concise if we placed the content in the bottom and did not start new page. For such cases to be renderered more accurately, one can call complete() when some content is still there and not flushed.

Implements iText.Layout.Element.ILargeElement.

◆ CreateRendererSubTree()

override IRenderer iText.Layout.Element.Table.CreateRendererSubTree ( )
inline

Creates a renderer subtree with root in the current table element.

Creates a renderer subtree with root in the current table element. Compared to GetRenderer() , the renderer returned by this method should contain all the child renderers for children of the current element.

Returns
a iText.Layout.Renderer.TableRenderer subtree for this element

Implements iText.Layout.Element.IElement.

◆ Flush()

virtual void iText.Layout.Element.Table.Flush ( )
inlinevirtual

Writes the newly added content to the document.

Implements iText.Layout.Element.ILargeElement.

◆ FlushContent()

virtual void iText.Layout.Element.Table.FlushContent ( )
inlinevirtual

Flushes the content which has just been added to the document.

Flushes the content which has just been added to the document. This is a method for internal usage and is called automatically by the document.

Implements iText.Layout.Element.ILargeElement.

◆ GetAccessibilityProperties()

override AccessibilityProperties iText.Layout.Element.Table.GetAccessibilityProperties ( )
inlinevirtual

Gets the accessibility properties.

Gets the accessibility properties . See also IAccessibleElement.

Returns
an interface that allows to specify properties of a tagged element in Tagged PDF.

Implements iText.Layout.Element.BlockElement< iText.Layout.Element.Table >.

◆ GetCaption()

virtual Div iText.Layout.Element.Table.GetCaption ( )
inlinevirtual

Gets the table's caption.

Returns
the table's caption.

◆ GetCell()

virtual Cell iText.Layout.Element.Table.GetCell ( int  row,
int  column 
)
inlinevirtual

Returns a cell as specified by its location.

Returns a cell as specified by its location. If the cell is in a col-span or row-span and is not the top left cell, then null is returned.

Parameters
row the row of the cell. indexes are zero-based
column the column of the cell. indexes are zero-based
Returns
the cell at the specified position.

◆ GetColumnWidth()

virtual UnitValue iText.Layout.Element.Table.GetColumnWidth ( int  column )
inlinevirtual

Returns the column width for the specified column.

Parameters
column index of the column
Returns
the width of the column

◆ GetFooter()

virtual iText.Layout.Element.Table iText.Layout.Element.Table.GetFooter ( )
inlinevirtual

Gets the footer of the table.

Gets the footer of the table. The footer is represented as a distinct table and might have its own properties.

Returns
table footer or null , if AddFooterCell(Cell) hasn't been called.

◆ GetHeader()

virtual iText.Layout.Element.Table iText.Layout.Element.Table.GetHeader ( )
inlinevirtual

Gets the header of the table.

Gets the header of the table. The header is represented as a distinct table and might have its own properties.

Returns
table header or null , if AddHeaderCell(Cell) hasn't been called.

◆ GetLastRowBottomBorder()

virtual IList<Border> iText.Layout.Element.Table.GetLastRowBottomBorder ( )
inlinevirtual

Gets the markup properties of the bottom border of the (current) last row.

Returns
an array of iText.Layout.Borders.Border objects

◆ GetNumberOfColumns()

virtual int iText.Layout.Element.Table.GetNumberOfColumns ( )
inlinevirtual

Returns the number of columns.

Returns
the number of columns.

◆ GetNumberOfRows()

virtual int iText.Layout.Element.Table.GetNumberOfRows ( )
inlinevirtual

Returns the number of rows.

Returns
the number of rows.

◆ GetRenderer()

override IRenderer iText.Layout.Element.Table.GetRenderer ( )
inline

Gets a table renderer for this element.

Gets a table renderer for this element. Note that this method can be called more than once. By default each element should define its own renderer, but the renderer can be overridden by AbstractElement.SetNextRenderer(iText.Layout.Renderer.IRenderer) method call.

Returns
a table renderer for this element

Implements iText.Layout.Element.IElement.

◆ GetRowGroups()

virtual IList<Table.RowRange> iText.Layout.Element.Table.GetRowGroups ( )
inlinepackagevirtual

Returns the list of all row groups.

Returns
a list of a RowRange which holds the row numbers of a section of a table

◆ IsComplete()

virtual bool iText.Layout.Element.Table.IsComplete ( )
inlinevirtual

Checks whether an element has already been marked as complete.

Returns
the completion marker boolean

Implements iText.Layout.Element.ILargeElement.

◆ IsSkipFirstHeader()

virtual bool iText.Layout.Element.Table.IsSkipFirstHeader ( )
inlinevirtual

Tells you if the first header needs to be skipped (for instance if the header says "continued from the previous page").

Returns
Value of property skipFirstHeader.

◆ IsSkipLastFooter()

virtual bool iText.Layout.Element.Table.IsSkipLastFooter ( )
inlinevirtual

Tells you if the last footer needs to be skipped (for instance if the footer says "continued on the next page")

Returns
Value of property skipLastFooter.

◆ SetAutoLayout()

virtual iText.Layout.Element.Table iText.Layout.Element.Table.SetAutoLayout ( )
inlinevirtual

Set auto layout.

Set auto layout. Analog of table-layout:auto CSS property.
Note, large table does not support auto layout.

Algorithm principles.

  1. Column width cannot be less, than min-width of any cell in the column (calculated by layout).
  2. Specified table width has higher priority, than sum of column and cell widths.
  3. Percent value of cell and column width has higher priority, than point value.
  4. Cell width has higher priority, than column width.
  5. If column has no width, it will try to reach max-value (calculated by layout).
Returns
this element.

◆ SetBorderCollapse()

virtual iText.Layout.Element.Table iText.Layout.Element.Table.SetBorderCollapse ( BorderCollapsePropertyValue  collapsePropertyValue )
inlinevirtual

Sets the type of border collapse.

Parameters
collapsePropertyValue

iText.Layout.Properties.BorderCollapsePropertyValue to be set as the border collapse type

Returns
this Table

◆ SetCaption() [1/2]

virtual iText.Layout.Element.Table iText.Layout.Element.Table.SetCaption ( Div  caption )
inlinevirtual

Sets the table's caption.

Sets the table's caption. If there is no iText.Layout.Properties.Property.CAPTION_SIDE set (note that it's an inheritable property), iText.Layout.Properties.CaptionSide.TOP will be used. Also the iText.Kernel.Pdf.Tagging.StandardRoles.CAPTION will be set on the element.

Parameters
caption The element to be set as a caption.
Returns
this element

◆ SetCaption() [2/2]

virtual iText.Layout.Element.Table iText.Layout.Element.Table.SetCaption ( Div  caption,
CaptionSide  side 
)
inlinevirtual

Sets the table's caption and its caption side.

Sets the table's caption and its caption side. Also the iText.Kernel.Pdf.Tagging.StandardRoles.CAPTION will be set on the element.

Parameters
caption The element to be set as a caption.
side The caption side to be set on the caption.
Returns
this element

◆ SetDocument()

virtual void iText.Layout.Element.Table.SetDocument ( Document  document )
inlinevirtual

Sets the document this element is bound to.

Sets the document this element is bound to. We cannot write a large element into several documents simultaneously because we would need more bulky interfaces for this feature. For now we went for simplicity.

Parameters
document the document

Implements iText.Layout.Element.ILargeElement.

◆ SetExtendBottomRow()

virtual iText.Layout.Element.Table iText.Layout.Element.Table.SetExtendBottomRow ( bool  isExtended )
inlinevirtual

Defines whether the Table should be extended to occupy all the space left in the available area in case it is the last element in this area.

Parameters
isExtended defines whether the Table should be extended
Returns
this Table

◆ SetExtendBottomRowOnSplit()

virtual iText.Layout.Element.Table iText.Layout.Element.Table.SetExtendBottomRowOnSplit ( bool  isExtended )
inlinevirtual

Defines whether the Table should be extended to occupy all the space left in the available area in case the area has been split and it is the last element in the split part of this area.

Parameters
isExtended defines whether the Table should be extended
Returns
this Table

◆ SetFixedLayout()

virtual iText.Layout.Element.Table iText.Layout.Element.Table.SetFixedLayout ( )
inlinevirtual

Set fixed layout.

Set fixed layout. Analog of table-layout:fixed CSS property. Note, the table must have width property, otherwise auto layout will be used.

Algorithm description

  1. Scan columns for width property and set it. All the rest columns get undefined value. Column width includes borders and paddings. Columns have set in constructor, analog of element in HTML.
  2. Scan the very first row of table for width property and set it to undefined columns. Cell width has lower priority in comparing with column. Cell width doesn't include borders and paddings.
    2.1 If cell has colspan and all columns are undefined, each column will get equal width: width/colspan.
    2.2 If some columns already have width, equal remain (original width minus existed) width will be added remainWidth/colspan to each column.
  3. If sum of columns is less, than table width, there are two options:
    3.1. If undefined columns still exist, they will get the rest remaining width.
    3.2. Otherwise all columns will be expanded proportionally based on its width.
  4. If sum of columns is greater, than table width, nothing to do.
Returns
this element.

◆ SetHorizontalBorderSpacing()

virtual iText.Layout.Element.Table iText.Layout.Element.Table.SetHorizontalBorderSpacing ( float  spacing )
inlinevirtual

Sets the horizontal spacing between this table 's cells.

Parameters
spacing a horizontal spacing between this table 's cells
Returns
this Table

◆ SetSkipFirstHeader()

virtual iText.Layout.Element.Table iText.Layout.Element.Table.SetSkipFirstHeader ( bool  skipFirstHeader )
inlinevirtual

Skips the printing of the first header.

Skips the printing of the first header. Used when printing tables in succession belonging to the same printed table aspect.

Parameters
skipFirstHeader New value of property skipFirstHeader.
Returns
this element

◆ SetSkipLastFooter()

virtual iText.Layout.Element.Table iText.Layout.Element.Table.SetSkipLastFooter ( bool  skipLastFooter )
inlinevirtual

Skips the printing of the last footer.

Skips the printing of the last footer. Used when printing tables in succession belonging to the same printed table aspect.

Parameters
skipLastFooter New value of property skipLastFooter.
Returns
this element

◆ SetVerticalBorderSpacing()

virtual iText.Layout.Element.Table iText.Layout.Element.Table.SetVerticalBorderSpacing ( float  spacing )
inlinevirtual

Sets the vertical spacing between this table 's cells.

Parameters
spacing a vertical spacing between this table 's cells
Returns
this Table

◆ StartNewRow()

virtual iText.Layout.Element.Table iText.Layout.Element.Table.StartNewRow ( )
inlinevirtual

Starts new row.

Starts new row. This mean that next cell will be added at the beginning of next line.

Returns
this element

◆ UseAllAvailableWidth()

virtual iText.Layout.Element.Table iText.Layout.Element.Table.UseAllAvailableWidth ( )
inlinevirtual

Set iText.Layout.Properties.Property.WIDTH = 100%.

Returns
this element