C# Class iTextSharp.text.Table

A Table is a Rectangle that contains Cells, ordered in some kind of matrix.
Tables that span multiple pages are cut into different parts automatically. If you want a table header to be repeated on every page, you may not forget to mark the end of the header section by using the method EndHeaders().

The matrix of a table is not necessarily an m x n-matrix. It can contain holes or cells that are bigger than the unit. Believe me or not, but it took some serious thinking to make this as userfriendly as possible. I hope you wil find the result quite simple (I love simple solutions, especially for complex problems).

Inheritance: Rectangle, ILargeElement
Afficher le fichier Open project: red-gate/iTextSharp-4.1.6 Class Usage Examples

Protected Properties

Свойство Type Description
autoFillEmptyCells bool
complete bool
convert2pdfptable bool
notAddedYet bool

Private Properties

Свойство Type Description
AssumeTableDefaults void
ErrorDimensions void
FillEmptyMatrixCells void
IsValidLocation bool
MergeInsertedTables void
PlaceCell void

Méthodes publiques

Méthode Description
AddCell ( Cell cell ) : void

Adds a Cell to the Table.

AddCell ( Cell aCell, int row, int column ) : void

Adds a Cell to the Table at a certain row and column.

AddCell ( Cell aCell, object aLocation ) : void

Adds a Cell to the Table at a certain location.

AddCell ( Phrase content ) : void

Adds a Cell to the Table.

This is a shortcut for AddCell(Cell cell). The Phrase will be converted to a Cell.

AddCell ( Phrase content, System location ) : void

Adds a Cell to the Table.

AddCell ( string content ) : void

Adds a Cell to the Table.

This is a shortcut for AddCell(Cell cell). The string will be converted to a Cell.

AddCell ( string content, System location ) : void

Adds a Cell to the Table.

This is a shortcut for AddCell(Cell cell, System.Drawing.Point location). The string will be converted to a Cell.

AddColumns ( int aColumns ) : void

Gives you the posibility to add columns.

Complete ( ) : void

Will fill empty cells with valid blank Cells

CreatePdfPTable ( ) : PdfPTable
DeleteAllRows ( ) : void
DeleteColumn ( int column ) : void

Deletes a column in this table.

DeleteLastRow ( ) : bool

Deletes the last row in this table.

DeleteRow ( int row ) : bool

Deletes a row.

EndHeaders ( ) : int

Marks the last row of the table headers.

FlushContent ( ) : void
GetBottom ( float margin ) : float
GetElement ( int row, int column ) : object

returns the element at the position row, column (Cast to Cell or Table)

GetEnumerator ( ) : IEnumerator

Gets an Iterator of all the Rows.

GetLeft ( float margin ) : float
GetRight ( float margin ) : float
GetTop ( float margin ) : float
GetWidths ( float left, float totalWidth ) : float[]

Gets an array with the positions of the borders between every column.

This method translates the widths expressed in percentages into the x-coordinate of the borders of the columns on a real document.

InsertTable ( Table aTable ) : void

To put a table within the existing table at the current position generateTable will of course re-arrange the widths of the columns.

InsertTable ( Table aTable, System p ) : void

To put a table within the existing table at the given position generateTable will of course re-arrange the widths of the columns.

InsertTable ( Table aTable, int row, int column ) : void

To put a table within the existing table at the given position generateTable will of course re-arrange the widths of the columns.

IsNestable ( ) : bool
Process ( IElementListener listener ) : bool

Processes the element by adding it (or the different parts) to an IElementListener.

SetAlignment ( string alignment ) : void

Sets the alignment of this paragraph.

SetWidths ( int widths ) : void

Sets the widths of the different columns (percentages).

You can give up relative values of borderwidths. The sum of these values will be considered 100%. The values will be recalculated as percentages of this sum.

Table ( int columns ) : System

Constructs a Table with a certain number of columns.

Table ( int columns, int rows ) : System

Constructs a Table with a certain number of columns and a certain number of Rows.

Private Methods

Méthode Description
AssumeTableDefaults ( Cell aCell ) : void

Sets the unset cell properties to be the table defaults.

ErrorDimensions ( ) : void
FillEmptyMatrixCells ( ) : void

Integrates all added tables and recalculates column widths.

IsValidLocation ( Cell aCell, System aLocation ) : bool

check if Cell 'fits' the table.

  • rowspan/colspan not beyond borders
  • spanned cell don't overlap existing cells
MergeInsertedTables ( ) : void

Integrates all added tables and recalculates column widths.

PlaceCell ( ArrayList someRows, Cell aCell, System aPosition ) : void

Inserts a Cell in a cell-array and reserves cells defined by row-/colspan.

Method Details

AddCell() public méthode

Adds a Cell to the Table.
public AddCell ( Cell cell ) : void
cell Cell a Cell
Résultat void

AddCell() public méthode

Adds a Cell to the Table at a certain row and column.
public AddCell ( Cell aCell, int row, int column ) : void
aCell Cell The Cell to add
row int The row where the Cell will be added
column int The column where the Cell will be added
Résultat void

AddCell() public méthode

Adds a Cell to the Table at a certain location.
public AddCell ( Cell aCell, object aLocation ) : void
aCell Cell The Cell to add
aLocation object The location where the Cell will be added
Résultat void

AddCell() public méthode

Adds a Cell to the Table.
This is a shortcut for AddCell(Cell cell). The Phrase will be converted to a Cell.
public AddCell ( Phrase content ) : void
content Phrase a Phrase
Résultat void

AddCell() public méthode

Adds a Cell to the Table.
public AddCell ( Phrase content, System location ) : void
content Phrase a Phrase
location System a System.Drawing.Point
Résultat void

AddCell() public méthode

Adds a Cell to the Table.
This is a shortcut for AddCell(Cell cell). The string will be converted to a Cell.
public AddCell ( string content ) : void
content string a string
Résultat void

AddCell() public méthode

Adds a Cell to the Table.
This is a shortcut for AddCell(Cell cell, System.Drawing.Point location). The string will be converted to a Cell.
public AddCell ( string content, System location ) : void
content string a string
location System a point
Résultat void

AddColumns() public méthode

Gives you the posibility to add columns.
public AddColumns ( int aColumns ) : void
aColumns int the number of columns to add
Résultat void

Complete() public méthode

Will fill empty cells with valid blank Cells
public Complete ( ) : void
Résultat void

CreatePdfPTable() public méthode

public CreatePdfPTable ( ) : PdfPTable
Résultat iTextSharp.text.pdf.PdfPTable

DeleteAllRows() public méthode

public DeleteAllRows ( ) : void
Résultat void

DeleteColumn() public méthode

Deletes a column in this table.
public DeleteColumn ( int column ) : void
column int the number of the column that has to be deleted
Résultat void

DeleteLastRow() public méthode

Deletes the last row in this table.
public DeleteLastRow ( ) : bool
Résultat bool

DeleteRow() public méthode

Deletes a row.
public DeleteRow ( int row ) : bool
row int the number of the row to delete
Résultat bool

EndHeaders() public méthode

Marks the last row of the table headers.
public EndHeaders ( ) : int
Résultat int

FlushContent() public méthode

public FlushContent ( ) : void
Résultat void

GetBottom() public méthode

public GetBottom ( float margin ) : float
margin float
Résultat float

GetElement() public méthode

returns the element at the position row, column (Cast to Cell or Table)
public GetElement ( int row, int column ) : object
row int
column int
Résultat object

GetEnumerator() public méthode

Gets an Iterator of all the Rows.
public GetEnumerator ( ) : IEnumerator
Résultat IEnumerator

GetLeft() public méthode

public GetLeft ( float margin ) : float
margin float
Résultat float

GetRight() public méthode

public GetRight ( float margin ) : float
margin float
Résultat float

GetTop() public méthode

public GetTop ( float margin ) : float
margin float
Résultat float

GetWidths() public méthode

Gets an array with the positions of the borders between every column.
This method translates the widths expressed in percentages into the x-coordinate of the borders of the columns on a real document.
public GetWidths ( float left, float totalWidth ) : float[]
left float this is the position of the first border at the left (cellpadding not included)
totalWidth float /// this is the space between the first border at the left /// and the last border at the right (cellpadding not included) ///
Résultat float[]

InsertTable() public méthode

To put a table within the existing table at the current position generateTable will of course re-arrange the widths of the columns.
public InsertTable ( Table aTable ) : void
aTable Table the table you want to insert
Résultat void

InsertTable() public méthode

To put a table within the existing table at the given position generateTable will of course re-arrange the widths of the columns.
public InsertTable ( Table aTable, System p ) : void
aTable Table the table you want to insert
p System
Résultat void

InsertTable() public méthode

To put a table within the existing table at the given position generateTable will of course re-arrange the widths of the columns.
public InsertTable ( Table aTable, int row, int column ) : void
aTable Table The Table to add
row int The row where the Cell will be added
column int The column where the Cell will be added
Résultat void

IsNestable() public méthode

public IsNestable ( ) : bool
Résultat bool

Process() public méthode

Processes the element by adding it (or the different parts) to an IElementListener.
public Process ( IElementListener listener ) : bool
listener IElementListener an IElementListener
Résultat bool

SetAlignment() public méthode

Sets the alignment of this paragraph.
public SetAlignment ( string alignment ) : void
alignment string the new alignment as a string
Résultat void

SetWidths() public méthode

Sets the widths of the different columns (percentages).
You can give up relative values of borderwidths. The sum of these values will be considered 100%. The values will be recalculated as percentages of this sum.
public SetWidths ( int widths ) : void
widths int an array with values
Résultat void

Table() public méthode

Constructs a Table with a certain number of columns.
public Table ( int columns ) : System
columns int The number of columns in the table
Résultat System

Table() public méthode

Constructs a Table with a certain number of columns and a certain number of Rows.
public Table ( int columns, int rows ) : System
columns int The number of columns in the table
rows int The number of rows
Résultat System

Property Details

autoFillEmptyCells protected_oe property

Boolean to automatically fill empty cells before a table is rendered (takes CPU so may be set to false in case of certainty)
protected bool autoFillEmptyCells
Résultat bool

complete protected_oe property

protected bool complete
Résultat bool

convert2pdfptable protected_oe property

protected bool convert2pdfptable
Résultat bool

notAddedYet protected_oe property

protected bool notAddedYet
Résultat bool