iText - avoid last row not to cut tables on page split to next page

前端 未结 3 2148
暖寄归人
暖寄归人 2020-12-10 05:45

I am working on itext 5 using java. I have pages with mutiple tables with dynamic rows. In some instances, the table last row is splitted into next page with the folowing he

3条回答
  •  北海茫月
    2020-12-10 06:09

    you can table.setKeepRowsTogather(true);

    table.setHeaderRows(1) as well alongwith it

    setKeepRowsTogather() checks if it can keep all the rows in page but splits the rows in case the table spans multiple pages. In that case setHeaderRows(1) will put the header rows again in the next page.

提交回复
热议问题