Source Code : Nested Table Cell
Java Is Open Source Programming Language You Can Download From Java and Java Libraries From http://www.oracle.com.
Click Here to download
We provide this code related to title for you to solve your developing problem easily. Libraries which is import in this program you can download from http://www.oracle.com.
Click Here or search from google with Libraries Name you get jar file related it
Nested Table Cell

import java.io.FileOutputStream;
import com.lowagie.text.Chunk;
import com.lowagie.text.Document;
import com.lowagie.text.Element;
import com.lowagie.text.Phrase;
import com.lowagie.text.Rectangle;
import com.lowagie.text.pdf.PdfContentByte;
import com.lowagie.text.pdf.PdfPCell;
import com.lowagie.text.pdf.PdfPTable;
import com.lowagie.text.pdf.PdfWriter;
public class NestedTableCellPDF {
public static void main(String[] args) {
Document document = new Document();
try {
PdfWriter writer = PdfWriter.getInstance(document, new FileOutputStream("NestedTableCellPDF.pdf"));
document.open();
PdfContentByte cb = writer.getDirectContent();
PdfPTable pageTot = new PdfPTable(1);
pageTot.getDefaultCell().setPadding(0f);
pageTot.getDefaultCell().setBorder(Rectangle.NO_BORDER);
pageTot.getDefaultCell().setHorizontalAlignment(Element.ALIGN_LEFT);
pageTot.setWidthPercentage(100f);
PdfPTable cell = new PdfPTable(1);
cell.getDefaultCell().setBorder(Rectangle.NO_BORDER);
cell.getDefaultCell().setPadding(0f);
PdfPCell info = new PdfPCell(new Phrase("Outside"));
info.setBorder(Rectangle.NO_BORDER);
pageTot.addCell(info);
PdfPCell shipment = new PdfPCell(new Phrase(new Chunk("Cell")));
shipment.setFixedHeight(100);
shipment.setPaddingTop(5f);
shipment.setPaddingBottom(10f);
shipment.setBorder(Rectangle.BOX);
shipment.setVerticalAlignment(Element.ALIGN_TOP);
shipment.setHorizontalAlignment(Element.ALIGN_CENTER);
cell.addCell(shipment);
pageTot.addCell(cell);
document.add(pageTot);
} catch (Exception e) {
e.printStackTrace();
}
document.close();
}
}
Thank with us