It works properly as long as you fill the row. If you have a table with 5
columns you must have 5 addCell() before a row is produced otherwise it's
the same as doing nothing. PdfPTable doesn't create automatically cells to
fill an incomplete row.

Best Regards,
Paulo Soares

> -----Original Message-----
> From: Daniel Brenner [SMTP:[EMAIL PROTECTED]]
> Sent: Monday, January 27, 2003 20:35
> To:   [EMAIL PROTECTED]
> Subject:      [iText-questions] PdfPTable in PdfPCell
> 
> Hi @all,
> 
> iText works pretty well for me since I switched from Table to PdfTable
> (or PdfPTable). Until I discovered yesterday that nested tables are
> still not working properly.
> I have table with 2 columns and I want to put a nested table into one
> cell. The amount of columns of this nested table depends on some values
> in a database. But from time to time cellTable does not get displayed in
> the pdf file (part of source code at the end of the mail). Any
> suggestions why?
> 
> Thanks in advance
> 
> Daniel Brenner
> 
> 
> 
> PdfPTable table = new PdfPTable(2);
> table.setWidthPercentage(100);
> table.getDefaultCell().setPadding(2);
> table.getDefaultCell().setPaddingBottom(6);
> int headerwidths[] = {16, 17};
> table.setWidths(headerwidths);
> 
> PdfPCell tableHeading = new PdfPCell(new Phrase("titel"));
> tableHeading.setHorizontalAlignment(Element.ALIGN_CENTER);
> tableHeading.setBorderWidth(0);
> tableHeading.setColspan(2);
> table.addCell(tableHeading);
> 
> table.addCell(new Phrase("colum"));
> table.addCell(new Phrase("colum"));
> table.setHeaderRows(2);
> 
> tableHeading.setVerticalAlignment(Element.ALIGN_MIDDLE);
> 
> PdfPTable cellTable = new PdfPTable(5);
> cellTable.setWidthPercentage(100);
> cellTable.getDefaultCell().setBorderWidth(0);
> cellTable.getDefaultCell().setHorizontalAlignment(Element.ALIGN_MIDDLE);
> cellTable.getDefaultCell().setVerticalAlignment(Element.ALIGN_MIDDLE);
> 
> 
> PdfPCell cell = new PdfPCell(new Phrase("1"));
> //    cell.setBorderWidth(0);
> cellTable.addCell(cell);
> 
> table.addCell(cellTable);
> 
> __________________________________________________________________
> 
> Gesendet von Yahoo! Mail - http://mail.yahoo.de
> Bis zu 100 MB Speicher bei http://premiummail.yahoo.de
> 
> 
> -------------------------------------------------------
> This SF.NET email is sponsored by:
> SourceForge Enterprise Edition + IBM + LinuxWorld = Something 2 See!
> http://www.vasoftware.com
> _______________________________________________
> iText-questions mailing list
> [EMAIL PROTECTED]
> https://lists.sourceforge.net/lists/listinfo/itext-questions


-------------------------------------------------------
This SF.NET email is sponsored by:
SourceForge Enterprise Edition + IBM + LinuxWorld = Something 2 See!
http://www.vasoftware.com
_______________________________________________
iText-questions mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/itext-questions

Reply via email to