I add a PdfTable inside a List and add this List into another PdfPCell. The
error is that the table inside the list is missing. The second problem is,
that I have to add an empty Phrase in front of the table because no number is
created.
Any ideas what I could do?
Code example:
document.open();
//create inner table
float[] width = {50,50};
PdfPTable table = new PdfPTable(width);
table.setWidthPercentage(100);
PdfPCell cell1 = new PdfPCell(new Phrase("Test1.1"));
PdfPCell cell2 = new PdfPCell(new Phrase("Test2.2"));
table.addCell(cell1);
table.addCell(cell2);
//create list with table inside
List list = new List(List.ORDERED, List.NUMERICAL);
list.setFirst(1);
ListItem item = new ListItem();
Phrase phrase = new Phrase("\u00a0");
item.add(phrase);
item.add(table);
list.add(item);
//create outside table with list inside
PdfPTable table2 = new PdfPTable(1);
table2.setWidthPercentage(100);
PdfPCell cell3 = new PdfPCell();
cell3.addElement(list);
table2.addCell(cell3);
document.add(table2);
-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
iText-questions mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/itext-questions
Buy the iText book: http://itext.ugent.be/itext-in-action/