代码拉取完成,页面将自动刷新
基于docx4j封装添加标题、段落、表格,及简单设置样式
DocxUtil docxUtil = new DocxUtil();
docxUtil.addP("这是一段文字");
R run = docxUtil.addP("第二段文字");
setHighLight(run, highLightColors.green.name());
setSize(run,"50");
run = docxUtil.addH("标题", 1);
setColor(run,"#00ff00");
setHighLight(run,highLightColors.yellow.name());
docxUtil.addH("标题2",2);
docxUtil.addH("标题3",3);
List<List<String>> list = new ArrayList();
for (int i = 0; i < 8; i++){
List<String> list2 = new ArrayList<String>();
for(int j = 0; j<4;j++){
list2.add("阿汉擦边");
}
list.add(list2);
}
docxUtil.addTable(list);
docxUtil.createWord("D:/test.docx");
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。