Skip to main content
Skip table of contents

What is the PdfPTable.DefaultCell property used for?

I need help explaining the Java documentation for PdfPTable.getDefaultCell.

The Java documentation for PdfPTable.getDefaultCell() reads:

Gets the default PdfPCell that will be used as reference for all the addCell methods except addCell(PdfPCell).

I don't understand this.

Posted on StackOverflow on Jun 3, 2014 by Water Cooler v2

If you use iText 7, you’ll find some changes in creating tables. PdfPTable and PdfPCell don’t exist anymore, we use Table and Cell.

You should use addCell() method to add any type of content you want (String, Image, BlockElement or Cell itself) and set different properties directly to it. The getDefaultCell() method doesn’t exist.

If you want to see how to answer this question in iText 5, follow this link.

JavaScript errors detected

Please note, these errors can depend on your browser setup.

If this problem persists, please contact our support.