Reputation: 59
I just want to change color of "PAN DETAILS"(cell text) in my code please tell with a good example.
PdfPTable table2 = new PdfPTable(1);
table2.setWidthPercentage(100);
PdfPCell cellsss;
cellsss = new PdfPCell(new Phrase("PAN DETAILS"));
cellsss.setBorderColorTop(BaseColor.BLACK);
cellsss.setColspan(0);
cellsss.setBorderColor(BaseColor.RED);
BaseColor myColorpan = WebColors.getRGBColor("#b60548");
cellsss.setBackgroundColor(myColorpan);
cellsss.setHorizontalAlignment(Element.ALIGN_CENTER);
table2.addCell(cellsss);
cellsss = new PdfPCell(new Phrase("PAN DETAILS"));
cellsss.setBorderColor(BaseColor.BLACK);
document.add(table2);
Upvotes: 2
Views: 16276