聚合全网技术文章,根据你的阅读喜好进行个性推荐
1. 通过设置表格的边框,可以实现!
public static PdfPCell createCellTL(String value, int align, Font font,int colspan) { //上左有边框的表格:1.表格内容;2.字体;3.对齐方式;4.横跨列数 PdfPCell cell = new PdfPCell(); //cell.setVerticalAlignment(Element.ALIGN_MIDDLE); cell.setHorizontalAlignment(align); //水平对齐 cell.setColspan(colspan); cell.setPhrase(new Phrase(value,textfont)); //设置表格的短语 cell.setPadding(5.0f); //设置内间距 cell.disableBorderSide(2); //隐藏下右边框 cell.disableBorderSide(8); return cell; }
1. 通过设置表格的边框,可以实现!
public static PdfPCell createCellTL(String value,
int align, Font font,int colspan) { //上左有边框的表格:1.表格内容;2.字体;3.对齐方式;4.横跨列数
PdfPCell cell = new PdfPCell();
//cell.setVerticalAlignment(Element.ALIGN_MIDDLE);
cell.setHorizontalAlignment(align); //水平对齐
cell.setColspan(colspan);
cell.setPhrase(new Phrase(value,textfont)); //设置表格的短语
cell.setPadding(5.0f); //设置内间距
cell.disableBorderSide(2); //隐藏下右边框
cell.disableBorderSide(8);
return cell;
}