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

# TableCell

extends ContentNode

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

## Class Overview

A class representing a table cell, which can be used during document creation.

## Summary

Nested Classes
enum | TableCell.CellAlignmentHorizontalVals |
enum | TableCell.CellAlignmentVerticalVals |

Public Methods
Paragraph | addParagraph() Add an empty paragraph to the cell
Paragraph | addParagraph(String text) Add a paragraph with text to the cell
Table | addTable() Add a nested table to the cell
double | getBorderThickness() Get the border thickness of the table cell
double | getHeight() Get the height of the cell
TableCell.CellAlignmentHorizontalVals | getHorizontalAlignment() Get the horizontal alignment of the cell
TableCell.CellAlignmentVerticalVals | getVerticalAlignment() Get the vertical alignment of the cell
double | getWidth() Get the width of the cell
TableCell | mergeCellsDown(int num) Merge the cell with the specified number of cells downwards
TableCell | mergeCellsRight(int num) Merge the cell with the specified number of cells to the right
void | setBackgroundColor(int red, int green, int blue) Set the background color of the cell The color values must be between 0 and 255, otherwise an exception will be thrown.
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 | setHeight(double val) Set the height of the cell
void | setHorizontalAlignment(TableCell.CellAlignmentHorizontalVals val) Set horizontal alignment of the cell
void | setVerticalAlignment(TableCell.CellAlignmentVerticalVals val) Set the vertical alignment of the cell
void | setWidth(double val) Set the width of the cell

[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 Paragraph addParagraph ()

Add an empty paragraph to the cell

##### Throws

PDFNetException |

#### public Paragraph addParagraph (String text)

Add a paragraph with text to the cell

##### Throws

PDFNetException |

#### public Table addTable ()

Add a nested table to the cell

##### Throws

PDFNetException |

#### public double getBorderThickness ()

Get the border thickness of the table cell

##### Returns

- border thickness

##### Throws

PDFNetException |

#### public double getHeight ()

Get the height of the cell

##### Returns

- the height of the cell

##### Throws

PDFNetException |

#### public TableCell.CellAlignmentHorizontalVals getHorizontalAlignment ()

Get the horizontal alignment of the cell

##### Returns

- the horizontal Alignment of the cell

##### Throws

PDFNetException |

#### public TableCell.CellAlignmentVerticalVals getVerticalAlignment ()

Get the vertical alignment of the cell

##### Returns

- the vertical alignment of the cell

##### Throws

PDFNetException |

#### public double getWidth ()

Get the width of the cell

##### Returns

- the width of the cell

##### Throws

PDFNetException |

#### public TableCell mergeCellsDown (int num)

Merge the cell with the specified number of cells downwards

##### Returns

- The merged cell

##### Throws

PDFNetException |

#### public TableCell mergeCellsRight (int num)

Merge the cell with the specified number of cells to the right

##### Returns

- The merged cell

##### Throws

PDFNetException |

#### public void setBackgroundColor (int red, int green, int blue)

Set the background color of the cell The color values must be between 0 and 255, otherwise an exception will be thrown.

##### Parameters

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 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
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 setHeight (double val)

Set the height of the cell

##### Parameters

val | The height of the cell

##### Throws

PDFNetException |

#### public void setHorizontalAlignment (TableCell.CellAlignmentHorizontalVals val)

Set horizontal alignment of the cell

##### Parameters

val | The horizontal alignment of the cell

##### Throws

PDFNetException |

#### public void setVerticalAlignment (TableCell.CellAlignmentVerticalVals val)

Set the vertical alignment of the cell

##### Parameters

val | The vertical alignment of the cell

##### Throws

PDFNetException |

#### public void setWidth (double val)

Set the width of the cell

##### Parameters

val | The width of the cell

##### Throws

PDFNetException |