81,092
社区成员
发帖
与我相关
我的任务
分享
Document document = new Document(PageSize.A4);
RtfWriter2.getInstance(document, new FileOutputStream(
"D:/test/word.doc"));
document.open();
Table table = new Table(2, 3);
table.setBorderWidth(4f);
table.setAlignment(2);
int[] widths = { 200, 100 };
table.setWidths(widths);
Cell cell = new Cell("test");
cell.setBorder(0);
table.addCell(cell);
document.add(table);
document.close();
//对应下图1
Document document = new Document(PageSize.A4);
RtfWriter2.getInstance(document, new FileOutputStream(
"D:/test/word.doc"));
document.open();
Table table = new Table(2, 3);
table.setBorderWidth(0f);
table.setAlignment(2);
int[] widths = { 200, 100 };
table.setWidths(widths);
Cell cell = new Cell("test");
cell.setBorder(0);
table.addCell(cell);
document.add(table);
document.close();
//对应下图2
Table table = new Table(2, 3);
table.setBorderWidth(0f);
Cell cell = new Cell(“test”);
cell.setBorder(0);
table.addCell(cell);
这样是有效果的吧,没有边框。