请问spiredoc在word文档中,读取的表格在填入数据后,为什么会默认有换行呢,如下图
Document doc= new Document(in);
Table table = doc.getSections().get(0).getTables().get(0);
TableCell tc1=table.getRows().get(0).getCells().get(1);
Paragraph para1 = new Paragraph(doc);
para1.appendText(ceshi);
tc1.getParagraphs().add(para1);
Document doc = new Document(in);
Table table = doc.getSections().get(0).getTables().get(0);
TableCell tc1 = table.getRows().get(0).getCells().get(1);
// 移除单元格中的所有子元素(包括换行符)
tc1.getParagraphs().get(0).removeAllChildren();
// 添加文本
Paragraph para1 = new Paragraph(doc);
para1.appendText(ceshi);
tc1.getParagraphs().add(para1);
有帮助请采纳一下,谢谢