繁体   English   中英

如何设置Apache POI XWPFTable表的边框粗细?

[英]How to Set Border thickness of Apache POI XWPFTable table?

我需要设置要看起来为粗体的表,如何设置粗细边框?

我知道如何更改边框borders.addNewBottom().setVal(STBorder.SINGLE);

但是如何改变边框的厚度呢?

编辑:我已经做到了。 像这样:

table3.getCTTbl().getTblPr().getTblBorders().getTop().setSz(BigInteger.valueOf(11));
                        table3.getCTTbl().getTblPr().getTblBorders().getLeft().setSz(BigInteger.valueOf(12));
                        table3.getCTTbl().getTblPr().getTblBorders().getRight().setSz(BigInteger.valueOf(12));
                        table3.getCTTbl().getTblPr().getTblBorders().getBottom().setSz(BigInteger.valueOf(12));
                        table3.getCTTbl().getTblPr().getTblBorders().getInsideH().setSz(BigInteger.valueOf(12));
                        table3.getCTTbl().getTblPr().getTblBorders().getInsideV().setSz(BigInteger.valueOf(12));

顺便说一句,我到底该知道setSz意味着什么?

你可以试试

borders.addNewBottom().setVal(STBorder.THICK);

STBorder类包含线条边界和艺术边界。 插入的所有内容都是线边框,可以在可以使用边框的任何地方使用。 从苹果到苹果的所有东西都是艺术边框,只能用于页面边框。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM