ตามที่อธิบายไว้ที่นี่: วิธีจัดรูปแบบเซลล์ใน XWPFTable ใน Apache POI
ฉันได้ลองใช้รหัสแล้ว
XWPFTable table = document.createTable();
CTTblLayoutType type = table.getCTTbl().getTblPr().addNewTblLayout();
type.setType(STTblLayoutType.FIXED);
ฉันสั่งให้มีคอลัมน์คงที่ แต่ฉันได้รับสัญลักษณ์ที่ไม่สามารถแก้ไขได้ 'CTTblLayoutType'
ฉันคิดว่าฉันมีการพึ่งพาที่จำเป็นทั้งหมดใน classpath ของฉัน:
<dependency>
<groupId>org.apache.poi</groupId>
<artifactId>poi</artifactId>
<version>${poi.version}</version>
</dependency>
<dependency>
<groupId>org.apache.poi</groupId>
<artifactId>poi-ooxml</artifactId>
<version>${poi.version}</version>
</dependency>
(ด้วย poi.version = 3.16)
มีความคิดอะไรบ้าง? ขอบคุณ.