Table table = new Table(2, 3); 
table.setBorderWidth(0f); 
Cell cell = new Cell(“test”); 
cell.setBorder(0); 
table.addCell(cell); 这样是有效果的吧,没有边框。

解决方案 »

  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(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
    图一
    图二图二你看到边框了?还是自己用这个测试代码看看。