简体   繁体   中英

itext 7.1.2 percent table width

There is a iText 7.0.7 method of table that works:

Table table = new Table(new float [] {4,1,3,4,3,3,3,3,1});
table.setWidthPercent(100);

But in iText 7.1.2 this method is not found:

table.setWidthPercent(100);

They know what the new method is or where it has moved, please.

Please try

table.setWidth(UnitValue.createPercentValue(100)):

In iText 7.1.x many dimension properties have been generalized to contain a UnitValue instance which can be either absolute (in points) or relative (in percent).

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