ITEXT7表格无边框(无边框) [英] ITEXT7 TABLE BORDERLESS (No Border)
本文介绍了ITEXT7表格无边框(无边框)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
下面的代码不起作用.
This code below does not work.
Table table = new Table(2);
table.setBorder(Border.NO_BORDER);
我是itext7的新手,我想要做的就是让我的桌子无边界. 喜欢怎么做?
I am new to itext7 and all I wanted is to have my table borderless. Like how to do it?
推荐答案
默认情况下,表格本身不负责iText7中的边框,而单元格则负责.如果要使用无边界表格,则需要将每个单元格都设置为无边界(如果仍然需要内部边界,则需要将外部单元格的边缘设置为无边界).
The table itself is by default not responsible for borders in iText7, the cells are. You need to set every cell to be borderless if you want a borderless table (or set the outer cells to have no border on the edge if you still want inside borders).
Cell cell = new Cell();
cell.add("contents go here");
cell.setBorder(Border.NO_BORDER);
table.addCell(cell);
这篇关于ITEXT7表格无边框(无边框)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文