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
From class com.pdftron.layout.ContentElement
From class java.lang.Object

Public Methods

public Paragraph addParagraph ()

Add an empty paragraph to the cell

public Paragraph addParagraph (String text)

Add a paragraph with text to the cell

public Table addTable ()

Add a nested table to the cell

public double getBorderThickness ()

Get the border thickness of the table cell

Returns
  • border thickness

public double getHeight ()

Get the height of the cell

Returns
  • the height of the cell

public TableCell.CellAlignmentHorizontalVals getHorizontalAlignment ()

Get the horizontal alignment of the cell

Returns
  • the horizontal Alignment of the cell

public TableCell.CellAlignmentVerticalVals getVerticalAlignment ()

Get the vertical alignment of the cell

Returns
  • the vertical alignment of the cell

public double getWidth ()

Get the width of the cell

Returns
  • the width of the cell

public TableCell mergeCellsDown (int num)

Merge the cell with the specified number of cells downwards

Returns
  • The merged cell

public TableCell mergeCellsRight (int num)

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

Returns
  • The merged cell

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

public void setHorizontalAlignment (TableCell.CellAlignmentHorizontalVals val)

Set horizontal alignment of the cell

Parameters
val The horizontal alignment of the cell

public void setVerticalAlignment (TableCell.CellAlignmentVerticalVals val)

Set the vertical alignment of the cell

Parameters
val The vertical alignment of the cell

public void setWidth (double val)

Set the width of the cell

Parameters
val The width of the cell