在Apache POI中将表边框设置为THICK

问题描述

我正在尝试创建带有粗边框的表。我尝试使用Setting Table borders to THICK,但使用LibreOffice 6.4.7时更改未反映在文档中(但更改在Microsoft Word中可见),并且仅限于使用LibreOffice

另一方面,如果我使用:

static void setCellBorders(XWPFTableCell cell,STBorder.Enum[] borderTypesLTRB) {
  CTTcBorders borders = CTTcBorders.Factory.newInstance();
  borders.addNewLeft().setVal(borderTypesLTRB[0]);
  borders.addNewTop().setVal(borderTypesLTRB[1]);
  borders.addNewRight().setVal(borderTypesLTRB[2]);
  borders.addNewBottom().setVal(borderTypesLTRB[3]);
  CTTcPr tcPr = cell.getCTTc().getTcPr();
  if (tcPr != null) {
   tcPr.setTcBorders(borders);
  } else {
   tcPr = CTTcPr.Factory.newInstance();
   tcPr.setTcBorders(borders);
   cell.getCTTc().setTcPr(tcPr);
  }
 }

我可以看到更改,但STBorder.THICK无法提供所需的厚度。

任何增加XWPFTable边框厚度的帮助将不胜感激。所需的厚度如图像中所示。 提前致谢。 image sample for desired thickness

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)