我知道这是wps内置的设置,请问一下有办法可以关掉这个吗
public static void main(String[] args) throws Exception {
String str = "<div><p style=\"text-align:left;word-break:break-all\">" +
"<figure class=\"table\" style=\"margin: 0.9em auto; display: table; ; margin:auto;display: table;\">" +
"<table height=\"100%\" style=\"width: 100%; height: 100%; \" width=\"100%\">" +
"<tbody>" +
"<tr><td align=\"center\">" +
"<p style=\"text-align:center;word-break:break-all\">" +
"<img src=\"https://cloudmockexam-1300694754.cos.ap-beijing.myqcloud.com/ww_wcp/paper/res/58014ce5d6d742c399cdeb7b03156574.png\"" +
" style=\"width:163.5px;height:204px; display: block; text-align: center; margin: auto;\"/></p>" +
"<p style=\"text-align:center;word-break:break-all\">" +
"<span style=\"font-family:楷体, KaiTi,宋体, SimSun\">杜甫像</span></p></td> " +
"<td align=\"center\" ><p style=\"text-align:center;word-break:break-all\">" +
"<img src=\"https://cloudmockexam-1300694754.cos.ap-beijing.myqcloud.com/ww_wcp/paper/res/7f61fe33e01b44eb80d16b9605c912d6.png\"" +
" style=\"width:159px;height:204px; display: block; text-align: center; margin: auto;\"/></p><p style=\"text-align:center;word-break:break-all\">" +
"<span style=\"font-family:楷体, KaiTi,宋体, SimSun\">白居易像</span></p></td></tr></tbody></table></figure>" +
"</div>";
DocumentBuilder builder = new DocumentBuilder(new Document());
builder.insertHtml(str);
NodeCollection<Table> tables = builder.getDocument().getChildNodes(NodeType.TABLE, true);
for (Table table : tables) {
// 设置表格的边框样式为无边框
for (Cell cell : (Iterable<Cell>) table.getChildNodes(NodeType.CELL, true)) {
cell.getCellFormat().getBorders().clearFormatting();
}
}
builder.getDocument().save("D:\\test.docx");
}