Summary: Methods | Inherited Methods | [Expand All]
public class

# Table

extends ContentNode

java.lang.Object
↳ | com.pdftron.layout.ContentElement
| ↳ | com.pdftron.layout.ContentNode
|  | ↳ | com.pdftron.layout.Table

## Class Overview

A Table is a content node that contains a grid of cells.

## Summary

Public Methods
TableRow | addTableRow() Add a new row to the table
double | getBorderThickness() Get the border thickness of the table
double | getDefaultRowHeight() Get default row height of the table
int | getNumColumns() Get the number of columns in the table
int | getNumRows() Get the number of rows in the table
TableCell | getTableCell(int column, int row) Get a cell from the table
void | setBorder(double thickness, int red, int green, int blue) Set the cell's border thickness and color The color values must be between 0 and 255, otherwise an exception will be thrown.
void | setDefaultColumnWidth(double val) Set default column weight of the table
void | setDefaultRowHeight(double val) Set default row height of the table

[Expand] Inherited Methods
From class com.pdftron.layout.ContentNode
ContentNodeIterator | getContentNodeIterator() Retrieve a ContentNodeIterator object from the content node The ContentNodeIterator object can be used to traverse the children of the content node.
From class com.pdftron.layout.ContentElement
ContentNode | asContentNode() Retrieve the `ContentNode` object for this content element if it is a content node.
List | asList() Retrieve the `List` object for this content element if it is a list.
ListItem | asListItem() Retrieve the `ListItem` object for this content element if it is a list item.
Paragraph | asParagraph() Retrieve the `Paragraph` object for this content element if it is a paragraph.
Table | asTable() Retrieve the `Table` object for this content element if it is a table.
TableCell | asTableCell() Retrieve the `TableCell` object for this content element if it is a table cell.
TableRow | asTableRow() Retrieve the `TableRow` object for this content element if it is a table row.
TextRun | asTextRun() Retrieve the `TextRun` object for this content element if it is a text run.
TextStyledElement | getTextStyledElement() Retrieve the `TextStyledElement` object for manipulating the text style of this content element.
From class java.lang.Object
boolean | equals(Object arg0)
final Class<?> | getClass()
int | hashCode()
final void | notify()
final void | notifyAll()
String | toString()
final void | wait(long arg0, int arg1)
final void | wait(long arg0)
final void | wait()

## Public Methods

#### public TableRow addTableRow ()

Add a new row to the table

##### Returns

- The newly created row

##### Throws

PDFNetException |

#### public double getBorderThickness ()

Get the border thickness of the table

##### Returns

- border thickness in points

##### Throws

PDFNetException |

#### public double getDefaultRowHeight ()

Get default row height of the table

##### Returns

- Default row height of the table

##### Throws

PDFNetException |

#### public int getNumColumns ()

Get the number of columns in the table

##### Returns

- number of columns in the table

##### Throws

PDFNetException |

#### public int getNumRows ()

Get the number of rows in the table

##### Returns

- number of rows in the table

##### Throws

PDFNetException |

#### public TableCell getTableCell (int column, int row)

Get a cell from the table

##### Parameters

column | The column index of the cell to retrieve
row | The row index of the cell to retrieve

##### Returns

- the TableCell at the specified column and row

##### Throws

PDFNetException |

#### public void setBorder (double thickness, int red, int green, int blue)

Set the cell's border thickness and color The color values must be between 0 and 255, otherwise an exception will be thrown.

##### Parameters

thickness | The thickness of the border in points
red | The red component of the border color
green | The green component of the border color
blue | The blue component of the border color

##### Throws

IllegalArgumentException | - if red, green or blue are outside of the range 0 to 255, inclusive
PDFNetException |

#### public void setDefaultColumnWidth (double val)

Set default column weight of the table

##### Parameters

val | The default column weight

##### Throws

PDFNetException |

#### public void setDefaultRowHeight (double val)

Set default row height of the table

##### Parameters

val | The default row height

##### Throws

PDFNetException |