Return a table's height
Brought to you by:
dogcane
Append the following code into pdfTables.cs, underneath
the rowsCount property definition:
/// <summary>
/// Height of this table
/// </summary>
/// <returns>Table height</returns>
public int tableHeight
{
get
{
int rowIndex = 0;
int currentHeight = 0;
if (_tableHeader.visible)
{
currentHeight =
tableHeader.rowHeight;
}
for (rowIndex = 0; rowIndex <
_rows.Count; rowIndex++)
{
currentHeight +=
_rows[rowIndex].rowHeight;
}
return currentHeight;
}
}
You can now examine myTable.tableHeight (after adding
a number of rows). This is useful if you need to position
elements below a table (e.g. another table).
Code was unceremoniously lifted from the cropTable
method.