By Date: <-- -->
By Thread: <-- -->

Problem with cell spacing on nested tables



I am trying to create a document that has text on one side of the page
and graphs on the other.  I created a main table with 2 cells.  Within
the 1st cell of the main table I put a table with the data.  In the
second cell I put a table with the graph depicting the data.

The nested tables are not acting independently.  I have attached a
screenshot of which I have turned on all the borders so you can see the
tables and cells more clearly.  How do I keep the graph table from
affecting the cell height of the data table?  Your help is greatly
appreciated!!

Here is my code snippet::
....
Table mainTbl = new Table( 2 );
mainTbl.setBorderWidth( 1 );
mainTbl.setPadding( 2 );
mainTbl.setSpacing( 0 );
mainTbl.setBorder( Rectangle.BOX );
int colwidths[] = {75,25};
mainTbl.setWidths( colwidths );

Cell mainCell = new Cell();
mainCell.setBorder( Rectangle.BOX );
mainCell.setVerticalAlignment( "top" );
mainCell.setHorizontalAlignment( "left" );
mainCell.setLeading(5);
mainCell.add( cashLblTbl );
mainTbl.addCell( mainCell );


mainCell = new Cell( chartTable );
mainCell.setBorder( Rectangle.BOX );
mainCell.setVerticalAlignment( "center" );
mainCell.setHorizontalAlignment( "center" );
mainTbl.addCell( mainCell );

mainCell = new Cell ( benLblTbl );
mainCell.setBorder( Rectangle.BOX );
mainCell.setVerticalAlignment( "top" );
mainCell.setHorizontalAlignment( "left" );
mainCell.setLeading(5);
mainTbl.addCell( mainCell );

mainCell = new Cell( chartTable2 );
mainCell.setBorder( Rectangle.BOX );
mainCell.setVerticalAlignment( "center" );
mainCell.setHorizontalAlignment( "center" );
mainTbl.addCell( mainCell );

document.add( mainTbl );
.....




Tracey Gates
Lead Developer
tgates (at) yoursummit.com

Attachment: tableSpacing.JPG
Description: JPEG image