I have created table in pdf document using itext in java. Working fine in functionality wise. But I need to display table as a below of document.
this is my code
PdfPTable datatablebottom = new PdfPTable(8);
PdfPCell cell = new PdfPCell();
cell.setBorder(Rectangle.NO_BORDER);
cell.setColspan(8);
cell.setBackgroundColor(BaseColor.GRAY);
cell.setBorderWidthTop(5.0f);
cell.setBorderColorTop(BaseColor.DARK_GRAY);
if(msgfb.equals("1")){
//document.add(new Paragraph(""));
cell.addElement(new Paragraph(""));
}else if(msgfb.equals("2")){
//document.add(new Paragraph("Thank you for your business"));
Paragraph pf = new Paragraph("Thank you for your business Thanks for your bussiness Thanks for your bussiness Thanks for your bussiness Thanks for your bussiness Thanks for your bussiness Thanks for your bussiness",BT_NORMAL);
pf.setAlignment(Element.ALIGN_CENTER);
cell.addElement(pf);
}else{
//document.add(new Paragraph(msgfb));
Paragraph pf = new Paragraph(msgfb,BT_NORMAL);
pf.setAlignment(Element.ALIGN_CENTER);
cell.addElement(pf);
//cell.addElement(new Paragraph(msgfb,BT_NORMAL));
}
cell.setPaddingBottom(10.0f);
datatablebottom.addCell(cell);
datatablebottom.setTotalWidth(PageSize.A4.getWidth()-70);
datatablebottom.setLockedWidth(true);
document.add(datatablebottom);