Page 1 of 1

Wie setze ich eine Hintergrundfarbe einer Tabellenzelle mit iText ein?

Posted: 21 May 2025, 11:57
by Anonymous
Während es natürlich möglich ist, Basecolor < /code> zu verwenden, bietet es standardmäßig nur sehr begrenzte Auswahlmöglichkeiten.

Code: Select all

...
PdfPTable table = new PdfPTable(3);

PdfPCell cell = new PdfPCell(new Phrase("some clever text"));
cell.setBackgroundColor(BaseColor.GREEN);
table.addCell(cell);
...