问问题描述
答精选答案

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;}
本文来自作者[neimenggushangmaozhiyexue]投稿,不代表公众科技网立场,如若转载,请注明出处:https://www.cpst.net.cn/jingxuan/4359767.html
评论列表(4条)
我是公众科技网的签约作者“neimenggushangmaozhiyexue”!
希望本篇文章《itext设置表格无边框怎么设置》能对你有所帮助!
本站[公众科技网]内容主要涵盖:教育咨询,知识百科
本文概览: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);