I want to add multiple Phrase in one PdfPCell. My concern is, I want to display like "Created Date :" in gray font and than "Date" in black font in one cell.
So, is there anyway to do this ? Please help.
Code is like,
PdfPCell cell = new PdfPCell(new Phrase("Created Date : ",grayFont));
Now, I want to add Date after that without adding new Cell. Is that possible?
Create a cell, and add as many Phrase
as needed :
PdfPCell cell = new PdfPCell();
cell.addElement(new Phrase("Created Date : ", grayFont));
cell.addElement(new Phrase(theDate, blackFont));
You could also consider adding Chunk
instead of Phrase
.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With