If you use iText 7, youâ€™ll find some changes in creating tables.
PdfPCell donâ€™t exist anymore, we use
You should use
addCell() method to add any type of content you want (
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.