全站数据
8 4 2 0 5 8 1

itext设置表格无边框怎么设置

心理学与生活 | 简单学习,快乐成才!         
问题更新日期:2024-11-11 02:27:35

问题描述

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);//水平对齐cell.setColspan(colspan);cell.setPhrase(new Phrase(value,textfont)); //设置表格的短语cell.setPadding(5.0f); //设置内间距cell.disableBorderSide(2);//隐藏下右边框cell.disableBorderSide(8);return cell;}