简体   繁体   English

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

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

I need to set my table that would like to look BOLD so how to set thickness border? 我需要设置要看起来为粗体的表,如何设置粗细边框?

I know how to change borders borders.addNewBottom().setVal(STBorder.SINGLE); 我知道如何更改边框borders.addNewBottom().setVal(STBorder.SINGLE);

But how to change border thickness? 但是如何改变边框的厚度呢?

EDIT: I've done it. 编辑:我已经做到了。 Like this: 像这样:

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));

BTW where the hell am I supposed to know what it means by setSz? 顺便说一句,我到底该知道setSz意味着什么?

You could try 你可以试试

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

The STBorder class contains both line borders and art borders. STBorder类包含线条边界和艺术边界。 Everything down to inset is a line border, and can be used wherever borders can be used. 插入的所有内容都是线边框,可以在可以使用边框的任何地方使用。 Everything from apple on down is an art border and can only be used for page borders. 从苹果到苹果的所有东西都是艺术边框,只能用于页面边框。

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

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