2017-10-20 120 views

回答

0

如API文檔(http://itextsupport.com/apidocs/itext7/latest/com/itextpdf/layout/element/Table.html#Table-float:A-boolean-)中所述,版本7.0.2中的表佈局算法已更改。最簡單的解決方案是與值true添加第二個參數的Table構造:

Table htable = new Table(new float[] {3, 8, 5, 10, 5, 10, 30}, true); 

構造的單參數版本現在需要絕對列寬點。

+0

或者,傳遞包含百分比單位值的'UnitValue []'。你可以使用'UnitValue.createPercentArray()'從float數組創建一個。 –