## com.lowagie.text.rtf
Class RtfTable

    java.lang.Object
      com.lowagie.text.rtf.RtfTable

public class RtfTable
extends Object

A Helper Class for the `RtfWriter`.

Do not use it directly, except if you want to write a `DocumentListener` for Rtf ONLY FOR USE WITH THE RtfWriter NOT with the RtfWriter2. Parts of this Class were contributed by Steffen Stundzig. Many thanks for the improvements. Updates Benoit WIART <b.wiart@proxiad.com>

Field Summary
`private Table` `origTable` Stores the Table, which this RtfTable is based on.
`private ArrayList` `rowsList` Stores the different rows.
`private RtfWriter` `writer` Stores the RtfWriter, which created this RtfTable.

Constructor Summary
`RtfTable(RtfWriter writer)` Create a new `RtfTable`.

Method Summary
`protected Table` `getOriginalTable()` This method allows access to the original Table that led to this RtfTable.
`boolean` `importTable(Table table, int pageWidth)` Import a `Table` into the `RtfTable`.
`void` `setMerge(int x, int y, int mergeType, RtfCell mergeCell)` `RtfCell`s call this method to specify that a certain other cell is to be merged with it.
`boolean` `writeTable(ByteArrayOutputStream os)` Output the content of the `RtfTable` to an OutputStream.

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Field Detail

### rowsList

    private ArrayList rowsList

  Stores the different rows.

### writer

    private RtfWriter writer

  Stores the RtfWriter, which created this RtfTable.

### origTable

    private Table origTable

  Stores the Table, which this RtfTable is based on.

Constructor Detail

### RtfTable

    public RtfTable(RtfWriter writer)

  Create a new `RtfTable`.

Parameters:
  `writer` - The `RtfWriter` that created this Table

Method Detail

### importTable

    public boolean importTable(Table table,
                               int pageWidth)

  Import a `Table` into the `RtfTable`.

  Parameters:
    `table` - A `Table` specifying the `Table` to be imported
    `pageWidth` - An `int` specifying the page width
  Returns:
    true if importing the table succeeded

### writeTable

    public boolean writeTable(ByteArrayOutputStream os)
                       throws DocumentException,
                              IOException

  Output the content of the `RtfTable` to an OutputStream.

  Parameters:
    `os` - The `OutputStream` that the content of the `RtfTable` is to be written to
  Returns:
    true if writing the table succeeded
  Throws:
    `DocumentException`
    `IOException`

### setMerge

    public void setMerge(int x,
                         int y,
                         int mergeType,
                         RtfCell mergeCell)

  `RtfCell`s call this method to specify that a certain other cell is to be merged with it.

  Parameters:
    `x` - The column position of the cell to be merged
    `y` - The row position of the cell to be merged
    `mergeType` - The merge type specifies the kind of merge to be applied (MERGE_HORIZ_PREV, MERGE_VERT_PREV, MERGE_BOTH_PREV)
    `mergeCell` - The `RtfCell` that the cell at x and y is to be merged with

### getOriginalTable

    protected Table getOriginalTable()

  This method allows access to the original Table that led to this RtfTable.

  Returns:
    The Table object that is the basis of this RtfTable.