com.lowagie.text.pdf

Class PdfTable

public class PdfTable extends Rectangle

PdfTable is an object that contains the graphics and text of a table.

See Also: Table Row Cell PdfCell

Field Summary
ArrayListcells
this is the ArrayList with all the cells in the table.
intcolumns
this is the number of columns in the table.
ArrayListheadercells
this is the ArrayList with all the cell of the table header.
protected float[]positions
Cached column widths.
protected Tabletable
Original table used to build this object
Constructor Summary
PdfTable(Table table, float left, float right, float top)
Constructs a PdfTable-object.
Method Summary
floatcellpadding()
Returns the cellpadding of the table.
floatcellspacing()
Returns the cellspacing of the table.
intcolumns()
Returns the number of columns of the table.
ArrayListgetCells()
Returns the arraylist with the cells of the table.
ArrayListgetHeaderCells()
Returns the arraylist with the cells of the table header.
floatgetOffset()
Gets the offset of this table.
booleanhasHeader()
Checks if there is a table header.
booleanhasToFitPageCells()
Checks if the cells of this Table have to fit a page.
booleanhasToFitPageTable()
Checks if this Table has to fit a page.
introws()
Get the number of rows
inttype()
voidupdateRowAdditions()
Updates the table row additions in the underlying table object and deletes all table rows, in order to preserve memory and detect future row additions.
voidupdateRowAdditionsInternal()
Updates the table row additions in the underlying table object

Field Detail

cells

private ArrayList cells
this is the ArrayList with all the cells in the table.

columns

private int columns
this is the number of columns in the table.

headercells

private ArrayList headercells
this is the ArrayList with all the cell of the table header.

positions

protected float[] positions
Cached column widths.

table

protected Table table
Original table used to build this object

Constructor Detail

PdfTable

PdfTable(Table table, float left, float right, float top)
Constructs a PdfTable-object.

Parameters: table a Table left the left border on the page right the right border on the page top the start position of the top of the table

Since: a parameter of this method has been removed in iText 2.0.8

Method Detail

cellpadding

final float cellpadding()
Returns the cellpadding of the table.

Returns: the cellpadding

cellspacing

final float cellspacing()
Returns the cellspacing of the table.

Returns: the cellspacing

columns

int columns()
Returns the number of columns of the table.

Returns: the number of columns

getCells

ArrayList getCells()
Returns the arraylist with the cells of the table.

Returns: an ArrayList

getHeaderCells

ArrayList getHeaderCells()
Returns the arraylist with the cells of the table header.

Returns: an ArrayList

getOffset

public float getOffset()
Gets the offset of this table.

Returns: the space between this table and the previous element.

hasHeader

boolean hasHeader()
Checks if there is a table header.

Returns: an ArrayList

hasToFitPageCells

public final boolean hasToFitPageCells()
Checks if the cells of this Table have to fit a page.

Returns: true if the cells may not be split

hasToFitPageTable

public final boolean hasToFitPageTable()
Checks if this Table has to fit a page.

Returns: true if the table may not be split

rows

int rows()
Get the number of rows

type

public int type()

See Also: type

updateRowAdditions

void updateRowAdditions()
Updates the table row additions in the underlying table object and deletes all table rows, in order to preserve memory and detect future row additions.

Pre-requisite: the object must have been built with the parameter supportUpdateRowAdditions equals to true.

updateRowAdditionsInternal

private void updateRowAdditionsInternal()
Updates the table row additions in the underlying table object