【发布时间】:2013-05-15 10:33:41
【问题描述】:
这是示例代码,“\t”不适用于此 setText 方法?:
XWPFDocument document = new XWPFDocument();
XWPFParagraph tp = document.createParagraph();
XWPFRun tRun = tp.createRun();
tRun.setText("a");
tRun.setText("\t"); // not work
tRun.setText("b");
FileOutputStream outStream = null;
try {
outStream = new FileOutputStream("testTabWithPOI.doc");
document.write(outStream);
outStream.close();
} catch (FileNotFoundException e) {
e.printStackTrace();
} catch (IOException e) {
e.printStackTrace();
}
【问题讨论】:
标签: java ms-office apache-poi doc