简体   繁体   中英

How to extendLastCell() in itext7?

In itext5 you can call setExtendLastRow(true); on a table. To have the last cell extend to the bottom of the page.

I am trying to have my itext7 table extend to bottom of page, even though it is just empty space.

I created a page border but it does not look as clean if the table's border spanned to the bottom of page.

Setting the height of the table does not work. The height property gets set but seems to not effect the actually height on the pdf page.

The name of the method providing this behavior has changed in iText7.

To extend the cells in the last row on every page, use

table.setExtendBottomRow(true);

To do the same for every page except the last one, use

table.setExtendBottomRowOnSplit(true);

Please note that this API will be available from release 7.0.2 on, which is not far away. This functionality is also already available in the latest SNAPSHOT version

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM