What is the PdfPTable.DefaultCell property used for?

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

31st May 2016

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.


Still have questions? 

We're happy to answer your questions. Reach out to us and we'll get back to you shortly.

Contact us
Stay updated

Join 11,000+ subscribers and become an iText PDF expert by staying up to date with our new products, updates, tips, technical solutions and happenings.

Subscribe Now