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.