我使用droidText库创建了一个表格,表格中的单元格没有正确格式化文本,因为文本会越过右边的单元格边框。
如您所见,描述单元格中的文本越过右侧边框。我正在使用:
PdfPTable descriptionAndCalcContent = new PdfPTable(4); // 4 columns.
descriptionAndCalcContent.setWidthPercentage(100);
descriptionAndCalcContent.setSpacingBefore(10f);
descriptionAndCalcContent.setWidths(new int[]{250, 50, 50, 50});
descriptionAndCalcContent.getDefaultCell().setBorderWidth(0f);
PdfPCell descriptionContent = new PdfPCell(new Paragraph("Descr iptionDescription Description Description Description Description" +
"Descri ption" +
"Descri ption" +
"Descr iption" +
"Description" +
"Descri ption" +
"Description" +
"Descri ption" +
"Descr iption" +
"Description Descript ionDescriptionDescr iptionD escriptionD escript onDescription Description" +
"DescriptionDes criptionDescripti onDescription" +
"Descri ption" +
"Desc ription" +
"Descrip tionDe scriptionDescriptionDescri ptionDesc riptionDescri ptionDes cription" +
""));
description.setBorder(Rectangle.NO_BORDER);
有谁知道如何解决这个问题?