java - iText making a whole roll in table coloured -
what's simplest way make whole table row coloured in pdf using itext? @ moment code below colours specific cell in table not sure how make entire row coloured.
would appreciate if can tell me how done please not post code! i'd code myself. thanks
for (int = 0; < rows; i++) { (int j = 0; j < cols; j++) { pdfpcell cell = new pdfpcell(new phrase(myjtable.getvalueat(i, j).tostring(), myfont)); if (phrase.tostring().contains("test")) { cell.setbackgroundcolor(basecolor.red); //i want change colour of //the entire row containing cell called "test", not cell } pdftable.addcell(cell); } }
if have pdfprow
object already, need call getcells()
on it, iterate through cells come back, setting colour of each.
if don't have pdfprow
already, can via gettable
method of pdfpcell
, getrow
method of pdfptable
.
Comments
Post a Comment