This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
POI生成Word时,设置段落的样式 | |
String style = "2"; //标题2的样式(这个值,我发现不同的文档值都不一样。。这里只是一个例子) | |
XWPFParagraph xwpfParagraph = doc.insertNewParagraph(run); | |
xwpfParagraph.setStyle(style); | |
其实设置其他的样式都一样。 | |
例如:你想设置你的样式为“标题2”(“标题2”只是你在word里看到的标题名称,实际上在xml中的名称可能不一样) | |
word里:我是标题2的样式 --这个段落在word里设置了标题2的样式 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
http://cyzus.github.io/2015/06/21/github-build-blog/ |