aTable.addCell("2.2", new Point(2,2));
aTable.addCell("3.3", new Point(3,3));
aTable.addCell("2.1", new Point(2,1));
aTable.addCell("1.3", new Point(1,3));
document.add(aTable);
document.add(new Paragraph("converted to PdfPTable:"));
aTable.setConvert2pdfptable(true);
document.add(aTable);
document.newPage();
aTable = new Table(4,4); // 4 rows, 4 columns
aTable.setAlignment(LwgElement.ALIGN_CENTER);
aTable.addCell("2.2", new Point(2,2));
aTable.addCell("3.3", new Point(3,3));
aTable.addCell("2.1", new Point(2,1));
aTable.addCell("1.3", new Point(1,3));
aTable.addCell("5.2", new Point(5,2));
aTable.addCell("6.1", new Point(6,1));
aTable.addCell("5.0", new Point(5,0));
document.add(aTable);
document.add(new Paragraph("converted to PdfPTable:"));
aTable.setConvert2pdfptable(true);
document.add(aTable);
document.newPage();
aTable = new Table(2,2); // 2 rows, 2 columns
aTable.setAlignment(LwgElement.ALIGN_LEFT);
aTable.setAutoFillEmptyCells(true);
aTable.addCell("0.0");
aTable.addCell("0.1");
aTable.addCell("1.0");
aTable.addCell("1.1");
aTable.addColumns(2);
float[] f = {1f, 1f, 1f, 1f};
aTable.setWidths(f);
aTable.addCell("2.2", new Point(2,2));
aTable.addCell("3.3", new Point(3,3));
aTable.addCell("2.1", new Point(2,1));
aTable.addCell("1.3", new Point(1,3));
aTable.addCell("5.2", new Point(5,2));
aTable.addCell("6.1", new Point(6,1));
aTable.addCell("5.0", new Point(5,0));
document.add(aTable);
document.add(new Paragraph("converted to PdfPTable:"));
aTable.setConvert2pdfptable(true);
document.add(aTable);
}
catch(DocumentException de) {
System.err.println(de.getMessage());