0

我使用 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);

有谁知道如何解决这个问题?

4

0 回答 0