I need your help in showing two PDFTables next to each other in iText. Now the first table is above the second table where now I need to keep them next to each other with a short space. Here is my code:
//First Table
dfPTable table = new PdfPTable(2);
Font earningsTitlefont = new Font(Font.TIMES_ROMAN,12, Font.BOLD);
PdfPCell c1 = new PdfPCell(new Phrase("Earnings Description",earningsTitlefont));
table.addCell(c1);
c1 = new PdfPCell(new Phrase("Earnings Amount",earningsTitlefont));
table.addCell(c1);
for (int i = 0; i < listEarnings.size(); i++) {
String temp1 = listEarnings.get(i).getEarningsDescriptionSS();
String temp2 = listEarnings.get(i).getEarningsAmountSS();
table.addCell(temp1);
table.addCell(temp2);
}
//Second Table
dfPTable tableDeductions = new PdfPTable(2);
Font fontTitleDeductions = new Font(Font.TIMES_ROMAN,12, Font.BOLD);
PdfPCell c2= new PdfPCell(new Phrase("Deductions Description",fontTitleDeductions ));
tableDeductions.addCell(c2);
c2 = new PdfPCell(new Phrase("Deductions Amount",fontTitleDeductions));
tableDeductions.addCell(c2);
for (int i = 0; i < listDeductionss.size(); i++) {
String temp3 = listDeductions.get(i).getDeductionssDescriptionSS();
String temp4 = listDeductions.get(i).getDeductionssAmountSS();
tableDeductions.addCell(temp3);
tableDeductions.addCell(temp4);
}
doc.add(table);
doc.add(Chunk.NEWLINE);
doc.add(tableDeductions);
(side by side tables) I'm not sure just check it.
// Main table
PdfPTable mainTable = new PdfPTable(2);
mainTable.setWidthPercentage(100.0f);
// First table
PdfPCell firstTableCell = new PdfPCell();
firstTableCell.setBorder(PdfPCell.NO_BORDER);
PdfPTable firstTable = new PdfPTable(2);
//......... add some cells here ...........
firstTableCell.addElement(firstTable);
mainTable.addCell(firstTableCell);
// Second table
PdfPCell secondTableCell = new PdfPCell();
secondTableCell.setBorder(PdfPCell.NO_BORDER);
PdfPTable secondTable = new PdfPTable(2);
//......... add some cells here ...........
secondTableCell.addElement(secondTable);
mainTable.addCell(secondTableCell);
paragraph.add(mainTable);
document.add(paragraph);
use
doc.add(new Phrase("\n"));
in place of
doc.add(Chunk.NEWLINE);
definably it's work for you. :)
I'm using iText 2.1.7,i'm adding header and footer at absolute position using writer.getDirectcontent() method.All is working fine except the fonts in first page gets darker than second pages.
Note the Header and Footer in First and second pages
anyhelp?
Here is what i did
Reader stringReader = new StringReader(svgXmlDoc);
Document document = new Document(PageSize.A4.rotate());
ByteArrayOutputStream content = new ByteArrayOutputStream();
try {
PdfWriter writer = PdfWriter.getInstance(document, content);
document.open();
PdfService event = new PdfService();
event.setHeader(date.toString());
event.onOpenDocument(writer, document);
event.onEndPage(writer, document);
event.onCloseDocument(writer, document);
writer.setPageEvent(event);
Image image1 = Image.getInstance("Infinity-Loop.png");
image1.scalePercent(35);
PdfPTable signature = new PdfPTable(numberOfSignature);
signature.setTotalWidth(document.getPageSize().getWidth()
- document.leftMargin() - document.rightMargin());
signature.setLockedWidth(true);
signature.setWidthPercentage(100);
signature.getDefaultCell().setFixedHeight(20);
signature.getDefaultCell().setHorizontalAlignment(
Element.ALIGN_RIGHT);
for (int i = 0; i < numberOfSignature; i++) {
PdfPCell cell = new PdfPCell(new Paragraph(
String.valueOf("____________")));
cell.setBorder(Rectangle.NO_BORDER);
cell.setHorizontalAlignment(Element.ALIGN_CENTER);
signature.addCell(cell);
}
PdfPTable header = new PdfPTable(3);
float[] columnWidths = {1f,2f,1f};
header.setWidths(columnWidths);
header.setTotalWidth(document.getPageSize().getWidth()
- document.leftMargin() - document.rightMargin());
header.setLockedWidth(true);
header.setWidthPercentage(100);
header.getDefaultCell().setPadding(15);
header.getDefaultCell().setBorder(Rectangle.NO_BORDER);
PdfPCell logocell = new PdfPCell(image1, false);
logocell.setRowspan(3);
logocell.setFixedHeight(72);
logocell.setBorder(Rectangle.NO_BORDER);
header.addCell(logocell);
PdfPCell Title = new PdfPCell(new Phrase(title,
FontFactory.getFont(FontFactory.TIMES_ROMAN, 18,
Font.PLAIN, new Color(0, 0, 0))));
Title.setBorder(Rectangle.NO_BORDER);
Title.setHorizontalAlignment(Element.ALIGN_CENTER);
header.addCell(Title);
header.addCell("");
header.completeRow();
PdfPCell SubTitle = new PdfPCell(new Phrase(subTitle));
SubTitle.setBorder(Rectangle.NO_BORDER);
SubTitle.setHorizontalAlignment(Element.ALIGN_CENTER);
header.addCell(SubTitle);
header.addCell("");
header.completeRow();
PdfPCell dataRange = new PdfPCell(new Phrase(
dateRange));
dataRange.setBorder(Rectangle.NO_BORDER);
dataRange.setHorizontalAlignment(Element.ALIGN_CENTER);
header.addCell(dataRange);
header.addCell("");
header.completeRow();
ArrayList tmp = header.getRows(0, header.getRows().size());
header.getRows().clear();
header.getRows().addAll(tmp);
int width = (int) ((int) document.getPageSize().getWidth()
- document.leftMargin() - document.rightMargin());
int height = 350;
PdfContentByte cb = writer.getDirectContent();
PdfTemplate template = cb.createTemplate(width, height);
Graphics2D g2 = template.createGraphics(width, height);
PrintTranscoder prm = new PrintTranscoder();
TranscoderInput ti = new TranscoderInput(stringReader);
prm.transcode(ti, null);
PageFormat pg = new PageFormat();
Paper pp = new Paper();
pp.setSize(width, height);
pp.setImageableArea(0, 0, width, height);
pg.setPaper(pp);
prm.print(g2, pg, 0);
g2.dispose();
ImgTemplate img = new ImgTemplate(template);
img.setAbsolutePosition(document.left(), document.topMargin() + 100);
document.add(img);
signature.writeSelectedRows(0, -1, document.left(),
document.bottom() + document.bottomMargin() * 2,
writer.getDirectContent());
header.writeSelectedRows(0, -1, document.left(), document.top(),
writer.getDirectContent());
document.newPage();
PdfPTable statisticsTitle=new PdfPTable(1);
statisticsTitle.setTotalWidth(document.right() - document.left());
statisticsTitle.setWidthPercentage(100);
PdfPCell titleCell= new PdfPCell(new Paragraph("Statistics Report"));
titleCell.setBorder(Rectangle.NO_BORDER);
titleCell.setHorizontalAlignment(Element.ALIGN_CENTER);
statisticsTitle.addCell(titleCell);
statisticsTitle.writeSelectedRows(0, -1, document.left(), document.top()
- document.topMargin() * 2 - 10, writer.getDirectContent());
PdfPTable table;
if(measurementType.equals("Temp")){
table = new PdfPTable(6);
}
else{
table = new PdfPTable(11);
}
table.setTotalWidth(document.right() - document.left());
table.setWidthPercentage(100);
table.setHeaderRows(1);
PdfPCell h1 = new PdfPCell(new Paragraph("Description"));
h1.setGrayFill(0.7f);
h1.setRowspan(2);
h1.setVerticalAlignment(Element.ALIGN_MIDDLE);
h1.setHorizontalAlignment(Element.ALIGN_CENTER);
table.addCell(h1);
PdfPCell h2 = new PdfPCell(new Paragraph("Temperature"));
h2.setGrayFill(0.7f);
h2.setColspan(5);
h2.setHorizontalAlignment(Element.ALIGN_CENTER);
table.addCell(h2);
if(measurementType.equals("TempHumi")){
PdfPCell h3 = new PdfPCell(new Paragraph("Humidity"));
h3.setGrayFill(0.7f);
h3.setColspan(5);
h3.setHorizontalAlignment(Element.ALIGN_CENTER);
table.addCell(h3);
}
table.getDefaultCell().setHorizontalAlignment(Element.ALIGN_CENTER);
PdfPCell tc1 = new PdfPCell(new Paragraph("Min"));
tc1.setGrayFill(0.7f);
tc1.setHorizontalAlignment(Element.ALIGN_CENTER);
table.addCell(tc1);
PdfPCell tc2 = new PdfPCell(new Paragraph("Max"));
tc2.setGrayFill(0.7f);
tc2.setHorizontalAlignment(Element.ALIGN_CENTER);
table.addCell(tc2);
PdfPCell tc3 = new PdfPCell(new Paragraph("Avg"));
tc3.setGrayFill(0.7f);
tc3.setHorizontalAlignment(Element.ALIGN_CENTER);
table.addCell(tc3);
PdfPCell tc4 = new PdfPCell(new Paragraph("Std"));
tc4.setGrayFill(0.7f);
tc4.setHorizontalAlignment(Element.ALIGN_CENTER);
table.addCell(tc4);
PdfPCell tc5 = new PdfPCell(new Paragraph("Mkt"));
tc5.setGrayFill(0.7f);
tc5.setHorizontalAlignment(Element.ALIGN_CENTER);
table.addCell(tc5);
if(measurementType.equals("TempHumi")){
PdfPCell hc1 = new PdfPCell(new Paragraph("Min"));
hc1.setGrayFill(0.7f);
hc1.setHorizontalAlignment(Element.ALIGN_CENTER);
table.addCell(hc1);
PdfPCell hc2 = new PdfPCell(new Paragraph("Max"));
hc2.setGrayFill(0.7f);
hc2.setHorizontalAlignment(Element.ALIGN_CENTER);
table.addCell(hc2);
PdfPCell hc3 = new PdfPCell(new Paragraph("Avg"));
hc3.setGrayFill(0.7f);
hc3.setHorizontalAlignment(Element.ALIGN_CENTER);
table.addCell(hc3);
PdfPCell hc4 = new PdfPCell(new Paragraph("Std"));
hc4.setGrayFill(0.7f);
hc4.setHorizontalAlignment(Element.ALIGN_CENTER);
table.addCell(hc4);
PdfPCell hc5 = new PdfPCell(new Paragraph("Mkt"));
hc5.setGrayFill(0.7f);
hc5.setHorizontalAlignment(Element.ALIGN_CENTER);
table.addCell(hc5);
}
ArrayList tmpTable = table.getRows(0, table.getRows().size());
table.getRows().clear();
table.getRows().addAll(tmpTable);
JsonObject listloggerdatastatistics = ReportService
.getStatisticsDetails(serialnumberlist);
System.out.println("Json "+listloggerdatastatistics.get("Sensormodellist"));
for (int row = 0; row < listloggerdatastatistics.get("Sensormodellist").getAsJsonArray().size(); row++) {
JsonObject jsonobj=listloggerdatastatistics.get("Sensormodellist").getAsJsonArray().get(row).getAsJsonObject();
if (row > 20 && row % 21 == 0) {
table.completeRow();
table.writeSelectedRows(0, 22, document.left(),
document.top() - document.topMargin() * 2 - 10,
writer.getDirectContent());
table.deleteBodyRows();
table.setSkipFirstHeader(true);
signature.writeSelectedRows(0, -1, document.left(),
document.bottom() + document.bottomMargin() * 3,
writer.getDirectContent());
header.writeSelectedRows(0, -1, document.left(),
document.top(), writer.getDirectContent());
document.newPage();
}
table.addCell(jsonobj.get("Modeltype").getAsString());
table.addCell(""+jsonobj.get("Mintemperature").getAsBigDecimal().setScale(2, RoundingMode.HALF_UP));
table.addCell(""+jsonobj.get("Maxtemperature").getAsBigDecimal().setScale(2, RoundingMode.HALF_UP));
table.addCell(""+jsonobj.get("Avgtemperature").getAsBigDecimal().setScale(2, RoundingMode.HALF_UP));
table.addCell(""+jsonobj.get("Stdtemperature").getAsBigDecimal().setScale(2, RoundingMode.HALF_UP));
table.addCell(""+jsonobj.get("Mkttemperature").getAsBigDecimal().setScale(2, RoundingMode.HALF_UP));
if(measurementType.equals("TempHumi")){
table.addCell(""+jsonobj.get("Minhumidity").getAsBigDecimal().setScale(2, RoundingMode.HALF_UP));
table.addCell(""+jsonobj.get("Maxhumidity").getAsBigDecimal().setScale(2, RoundingMode.HALF_UP));
table.addCell(""+jsonobj.get("Avghumidity").getAsBigDecimal().setScale(2, RoundingMode.HALF_UP));
table.addCell(""+jsonobj.get("Stdhumidity").getAsBigDecimal().setScale(2, RoundingMode.HALF_UP));
table.addCell("-");
}
}
table.completeRow();
table.writeSelectedRows(0, -1, document.left(), document.top()
- document.topMargin() * 3 - 10, writer.getDirectContent());
signature.writeSelectedRows(0, -1, document.left(),
document.bottom() + document.bottomMargin() * 2,
writer.getDirectContent());
header.writeSelectedRows(0, -1, document.left(), document.top(),
writer.getDirectContent());
} catch (DocumentException e) {
System.err.println(e);
}
document.close();
content.close();
I'm constructing graph image from SVG and table data are populated from database
Event handlers for adding footer with page X of Y
public class PdfService extends PdfPageEventHelper {
/** The header text. */
String header;
/** The template with the total number of pages. */
PdfTemplate total;
/**
* Fills out the total number of pages before the document is closed.
*
* #see com.itextpdf.text.pdf.PdfPageEventHelper#onCloseDocument(com.itextpdf.text.pdf.PdfWriter,
* com.itextpdf.text.Document)
*/
#Override
public void onCloseDocument(PdfWriter writer, Document document) {
total.reset();
ColumnText
.showTextAligned(total, Element.ALIGN_LEFT,
new Phrase(String.valueOf(writer.getPageNumber() - 1)),
2, 2, 0);
}
/**
* Adds a header to every page
*
* #see com.itextpdf.text.pdf.PdfPageEventHelper#onEndPage(com.itextpdf.text.pdf.PdfWriter,
* com.itextpdf.text.Document)
*/
#Override
public void onEndPage(PdfWriter writer, Document document) {
PdfPTable table = new PdfPTable(4);
try {
table.setWidths(new float[] { (float) (2.25), (float) (1.5), 11, 13 });
table.setTotalWidth(document.getPageSize().getWidth()
- document.leftMargin() - document.rightMargin());
table.setLockedWidth(true);
table.setWidthPercentage(100);
table.getDefaultCell().setFixedHeight(20);
table.getDefaultCell().setBorder(Rectangle.NO_BORDER);
table.getDefaultCell().setHorizontalAlignment(Element.ALIGN_RIGHT);
table.addCell(String.format("Page %d of", writer.getPageNumber()));
Image img = Image.getInstance(total);
Chunk conte = new Chunk(img, 0, 0);
Phrase chunk = new Phrase(conte);
PdfPCell cell = new PdfPCell(chunk);
cell.setBorder(Rectangle.NO_BORDER);
cell.setHorizontalAlignment(Element.ALIGN_LEFT);
cell.setVerticalAlignment(Element.ALIGN_TOP);
table.addCell(cell);
table.getDefaultCell().setHorizontalAlignment(Element.ALIGN_RIGHT);
table.addCell("SuperAdmin");
table.getDefaultCell().setHorizontalAlignment(Element.ALIGN_RIGHT);
table.addCell(header);
table.writeSelectedRows(0, -1, document.leftMargin(),
document.bottom(), writer.getDirectContent());
} catch (DocumentException de) {
throw new ExceptionConverter(de);
}
}
/**
* Creates the PdfTemplate that will hold the total number of pages.
*
* #see com.itextpdf.text.pdf.PdfPageEventHelper#onOpenDocument(com.itextpdf.text.pdf.PdfWriter,
* com.itextpdf.text.Document)
*/
#Override
public void onOpenDocument(PdfWriter writer, Document document) {
total = writer.getDirectContent().createTemplate(15, 14);
// total.setBoundingBox(new Rectangle(-1, 6, 20, 20));
}
/**
* Allows us to change the content of the header.
*
* #param header
* The new header String
*/
public void setHeader(String header) {
this.header = header;
}
}
In old days, when people had one font program for one regular font and no separate font file for a bold font, people found ways to work around this problem, and Adobe Reader was adapted to make this workaround work.
The workaround consists of writing the same content twice (or more) at the same position. When you add "Page 1 of 2" once, the font is presented as a regular font. When you add it twice, the font is presented as a bold font.
This is what happens in your case: you are adding the footer twice. This is wrong:
document.open();
PdfService event = new PdfService();
event.setHeader(date.toString());
event.onOpenDocument(writer, document);
event.onEndPage(writer, document);
event.onCloseDocument(writer, document);
writer.setPageEvent(event);
You invoke event.onEndPage() yourself, adding the footer a first time. When a page is finished, iText calls the onEndPage() method a second time, adding the footer once more, resulting in a bold font.
You should adapt your code like this:
PdfService event = new PdfService();
event.setHeader(date.toString());
writer.setPageEvent(event);
document.open();
You should declare the event to the PdfWriter instance before opening the document. You should not call the onOpenDocument(), onEndPage() and onCloseDocument() methods yourself! They are called internally by iText.
You should also upgrade to the latest version for the reasons explained on the FAQ. Using Open Source and contributing nothing in return is unwise. Supporting your open source communities isn’t charity, it’s good business.
in a PdfPCell i'd like to put multiple images, and a text below each image.
i tried with this code:
private PdfPTable tabellaRighe() throws BadElementException, MalformedURLException, IOException, DocumentException {
int[] cellWidth = {500, 95};
PdfPTable table = new PdfPTable(2);
table.setWidths(cellWidth);
table.setTotalWidth(PageSize.A4.getWidth() - 45);
table.setLockedWidth(true);
PdfPCell cell;
cell = new PdfPCell();
cell.setBorderWidth(0);
Paragraph p = new Paragraph();
for (int i = 0; i < 4; i++) {
Image image = Image.getInstance(imgNd);
image.scaleToFit(300, 135);
Phrase ph = new Phrase();
ph.add(new Chunk(image, 0, 0, true));
ph.add("CIAO");
p.add(ph);
}
cell.addElement(p);
table.addCell(cell);
cell = new PdfPCell();
cell.setBorderWidthBottom(1);
cell.setBorderWidthLeft(1);
cell.setBorderWidthRight(1);
cell.setBorderWidthTop(1);
table.addCell(cell);
}
but the text is not below the image, but shifted to the right.
how can I put the text below each image?
Add \n before and after text.
ph.add("\nCIAO\n");
\n produce new line.
I am generating pdf file using com.itextpdf.text.* following is my code which creates the pdf file with title and header higlighted and rows, what i wanted to do is, create a pdf file with image on the top and rows with alternate color, how to do this in using com.itextpdf.text.*
response.setHeader("Content-disposition", "attachment; filename=\"" + reportName + ".pdf\"");
response.setContentType("application/pdf");
PdfWriter.getInstance(document,response.getOutputStream());
try {
document.open();
addTitlePage(document, reportName);
//float[] colsWidth = {1.5f,3f,4f,4f,2f};
List<Float> colsWidth = new ArrayList<Float>();
int iterator = 1;
while (iterator <= headerMap.size()) {
if(iterator==1){
colsWidth.add(1.5f);
}else{
colsWidth.add(3f);
}
iterator++;
}
float[] floatArray = ArrayUtils.toPrimitive(colsWidth.toArray(new Float[0]), 0.0F);
PdfPTable table = new PdfPTable(floatArray);
table.setWidthPercentage(98);
table.setHorizontalAlignment(Element.ALIGN_CENTER);
PdfPCell c1 = new PdfPCell();
for (Iterator it = headerMap.keySet().iterator(); it.hasNext();) {
String headerName = (String) headerMap.get(it.next());
c1 = new PdfPCell(new Phrase(headerName, headerFont));
c1.setBackgroundColor(BaseColor.LIGHT_GRAY);
table.addCell(c1);
}
table.setHeaderRows(1);
table = custDAO.creadPDFTable(query, table);
document.add(table);
document.addAuthor(userViewModel.getUsername());
document.addCreationDate();
document.addCreator("POC");
document.close();
response.flushBuffer();
public PdfPTable creadPDFTable(String query,PdfPTable table){
int numberOfColumns=0,sno=1;
Connection connection = getConnection();
if (connection != null) {
try {
PreparedStatement reportTablePS = connection.prepareStatement(query);
ResultSet reportTable_rst = reportTablePS.executeQuery();
ResultSetMetaData reportTable_rsmd = reportTable_rst.getMetaData();
numberOfColumns = reportTable_rsmd.getColumnCount();
while (reportTable_rst.next()) {
table.addCell(new PdfPCell(new Paragraph(String.valueOf(sno), textFont)));
for (int columnIterator = 1; columnIterator <= numberOfColumns; columnIterator++) {
String column = reportTable_rst.getString(columnIterator);
table.addCell(new PdfPCell(new Paragraph(column, textFont)));
}
sno++;
}
} catch (Exception ex) {
ex.printStackTrace();
}finally {
try {
closeConnection(connection, null, null);
} catch (Exception ex) {
ex.printStackTrace();
}
}
}
return table;
}
private static void addTitlePage(Document document, String reportName) throws DocumentException {
Paragraph preface = new Paragraph();
addEmptyLine(preface, 1);
/**
* Lets write a big header
*/
Paragraph paragraph = new Paragraph(reportName, titleFont);
paragraph.setAlignment(Element.ALIGN_CENTER);
document.add(paragraph);
/**
* Add one empty line
*/
addEmptyLine(preface, 1);
document.add(preface);
}
private static void addEmptyLine(Paragraph paragraph, int number) {
for (int i = 0; i < number; i++) {
paragraph.add(new Paragraph(" "));
}
}
when i use the following i get the following exception 'getoutputstream() has already called for this response'
i wanted to use this for inserting image.
Image image = Image.getInstance(path+"images/abi.png");
image.setAbsolutePosition(40f, 770f);
image.scaleAbsolute(70f, 50f);
document.add(image);
so how to go about doing this?
UPDATE :
i want to create a pdf file like this i just want to add image on the top and rows with alternate color like this.
http://what-when-how.com/itext-5/decorating-tables-using-table-and-cell-events-itext-5/
(source: what-when-how.com)
(source: what-when-how.com)
You can use XSLFO and Apache FOP. It worked for me. For adding a image I done changes in XSL.
For reference visit
http://www.codeproject.com/Articles/37663/PDF-Generation-using-XSLFO-and-FOP
I'm trying to vertically align a table in my document to the bottom of the page.
I've set the vertical alignment of the table to BOTTOM but that just makes the cells align to the bottom of the table itself.
How can I make the Document itself vertically aligned to the bottom?
Thanks
After many days of searching.. my solution was to wrap my table in an outer table with 1 cell. Set the cell to the height of the page minus the two margins and set vertical alignment to the bottom. Add all content you want bottom justified to this table.
Full example, error code omitted for brevity
public void run() {
try {
Document document = new Document(PageSize.LETTER, 10.0f, 10.0f, 36.0f, 36.0f);
PdfWriter pdfWriter = PdfWriter.getInstance(document, new FileOutputStream("test.pdf"));
document.open();
PdfPTable outerTable = new PdfPTable(1);
outerTable.setWidthPercentage(100.0f);
PdfPCell cell = new PdfPCell();
cell.setMinimumHeight(document.getPageSize().getHeight() - 36.0f - 36.0f);
cell.setVerticalAlignment(Element.ALIGN_BOTTOM);
cell.addElement(createTable());
outerTable.addCell(cell);
document.add(outerTable);
document.newPage();
document.close();
} catch (Exception e) {
e.printStackTrace();
}
}
public PdfPTable leftTable() {
PdfPTable table = new PdfPTable(1);
for (int i = 0; i < 50; i++) {
table.addCell("Cell: " + i);
}
return table;
}
public PdfPTable middleTable() {
PdfPTable table = new PdfPTable(1);
for (int i = 0; i < 10; i++) {
table.addCell("Cell: " + i);
}
return table;
}
public PdfPTable rightTable() {
PdfPTable table = new PdfPTable(1);
for (int i = 0; i < 100; i++) {
table.addCell("Cell: " + i);
}
return table;
}
public PdfPTable createTable() {
PdfPTable table = new PdfPTable(3);
table.getDefaultCell().setVerticalAlignment(Element.ALIGN_BOTTOM);
table.addCell(leftTable());
table.addCell(middleTable());
table.addCell(rightTable());
return table;
}