|
@@ -147,6 +147,15 @@ public class NpoiHelper {
|
|
|
for (int col = 0; col < tableTitle.size(); col++) {
|
|
|
TableTitle cobj = tableTitle.get(col);
|
|
|
XWPFTableCell cell = mr.getCell(col);
|
|
|
+
|
|
|
+ // 设置内容单元格的宽度
|
|
|
+ CTTc ctTc = cell.getCTTc();
|
|
|
+ CTTcPr ctTcPr = ctTc.isSetTcPr() ? ctTc.getTcPr() : ctTc.addNewTcPr();
|
|
|
+ CTTblWidth ctTblWidth = ctTcPr.addNewTcW();
|
|
|
+ int width = tableTitle.get(col).getWidth();
|
|
|
+ ctTblWidth.setW(BigInteger.valueOf(width));
|
|
|
+ ctTblWidth.setType(STTblWidth.DXA);
|
|
|
+
|
|
|
Object o = datas.get(row).get(cobj.key);
|
|
|
String text = o == null ? "" : o.toString();
|
|
|
if (cobj.xsw > -1) {
|