0
itextpdf를 사용하여 셀의 테두리 4 가지 색상을 설정하고 싶습니다. 아래 코드를 사용하면 작동하지 않습니다. 제발 도와주세요. 이것을 해결하십시오.자바에서 itextpdf를 사용하여 표 셀의 테두리에 다른 색상을 설정하는 방법
private static PdfPTable insertCell(PdfPTable table, String text, int align, int colspan, Font font){
PdfPCell cell = new PdfPCell(new Phrase(text.trim(), font));
cell.setHorizontalAlignment(align);
cell.setVerticalAlignment(Element.ALIGN_MIDDLE);
cell.setColspan(colspan);
cell.setBackgroundColor(new BaseColor(hex2Rgb(color)));
cell.setBorderColorTop(BaseColor.BLUE);
cell.setBorderWidthTop(1f);
cell.setBorder(Rectangle.TOP);
cell.setBorderColorRight(BaseColor.ORANGE);
cell.setBorderWidthRight(1f);
cell.setBorder(Rectangle.RIGHT);
cell.setBorderColorBottom(BaseColor.RED);
cell.setBorderWidthBottom(1f);
cell.setBorder(Rectangle.BOTTOM);
cell.setBorderColorLeft(BaseColor.GREEN);
cell.setBorderWidthLeft(1f);
cell.setBorder(Rectangle.LEFT);
cell.setMinimumHeight(25f);
//add the call to the table
table.addCell(cell);
return table;
}
을 설정 한 후 color.But가 국경을 재설정하지 않는 설정하려면
... :) – user2210071
당신은 환영 친구입니다 –
왼쪽의 오른쪽 기호도 클릭하여 답을 수락 할 수 있습니다. D –