我需要设置Apache POI XWPFTable表的外边框.我知道下面的命令设置了insade border,但是没有找到设置外边框的方法.
table.setInsideHBorder( XWPFBorderType.SINGLE, 4, 0, "FF0000");
有帮助吗?提前致谢!
我找到了:
CTTblPr tblpro = table.getCTTbl().getTblPr(); CTTblBorders borders = tblpro.addNewTblBorders(); borders.addNewBottom().setVal(STBorder.SINGLE); borders.addNewLeft().setVal(STBorder.SINGLE); borders.addNewRight().setVal(STBorder.SINGLE); borders.addNewTop().setVal(STBorder.SINGLE); //also inner borders borders.addNewInsideH().setVal(STBorder.SINGLE); borders.addNewInsideV().setVal(STBorder.SINGLE);