Change a specific PdfPCell in itext for java? -
i have table in itext.
need change specific cell width in last row.
possible?
edit: colspan not cover problem. need different widths in row.
there many ways change last row cell width :
a. colspan, of course you'll need cells fit other rows.
example :
pdfptable table = new pdfptable(3); table.addcell("cell a0"); table.addcell("cell a1"); table.addcell("cell a2"); table.addcell("cell b0"); table.addcell("cell b1"); table.addcell("cell b2"); pdfpcell cell = new pdfpcell(); cell.setcolspan(2); cell.addelement(new phrase("c0 & c1")); table.addcell(cell); table.addcell("cell c2");
b. 2 tables same total width, no space between tables.
example :
pdfptable table = new pdfptable(1); pdfptable table1 = new pdfptable(3); table1.setwidthpercentage(100f); table1.addcell("cell a0"); table1.addcell("cell a1"); table1.addcell("cell a2"); pdfptable table2 = new pdfptable(2); table2.setwidthpercentage(100f); table2.addcell("cell b0"); table2.addcell("cell b1"); table.addcell(table1); table.addcell(table2);
Comments
Post a Comment