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

Popular posts from this blog

android - Get AccessToken using signpost OAuth without opening a browser (Two legged Oauth) -

org.mockito.exceptions.misusing.InvalidUseOfMatchersException: mockito -

google shop client API returns 400 bad request error while adding an item -