To avoid having the cell border and the content overlap, if you are having thick cell bordersĪddTableExample Pdf Output 7. PdfPCell cell3 = new PdfPCell(new Paragraph("Cell 3")) ĬtHorizontalAlignment(Element.ALIGN_CENTER) ĬtVerticalAlignment(Element.ALIGN_MIDDLE) PdfPCell cell2 = new PdfPCell(new Paragraph("Cell 2")) ĬtHorizontalAlignment(Element.ALIGN_CENTER) ĬtVerticalAlignment(Element.ALIGN_MIDDLE) PdfPCell cell1 = new PdfPCell(new Paragraph("Cell 1")) ĬtHorizontalAlignment(Element.ALIGN_CENTER) ĬtVerticalAlignment(Element.ALIGN_MIDDLE) PdfPTable table = new PdfPTable(3) // 3 columns. PdfWriter writer = PdfWriter.getInstance(document, new FileOutputStream("AddTableExample.pdf")) Generating a Table in PDFīelow example shows how to add tables in a pdf document. Simple and clear.ĪddImageExample Pdf Output 6.
0 Comments
Leave a Reply. |
Details
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |