2010-05-12 4 views
0

테이블 내부의 셀에는 테두리가 없지만 외부 테두리 만있는 방법이 있습니까?itext 테이블의 외부 테두리

뭔가 같은 :

______________ 
| cell 1 c2 | 
|    | 
|______________| 

나는, iTextSharp의 PDF 라이브러리에 대해 이야기하고

답변

0

간단한 해결책은 0.0f로 셀의 테두리 너비를 설정하고의 위쪽 테두리 폭을 변경하는 것 첫 번째 행, 마지막의 아래쪽 테두리 폭, 그리고 첫 번째와 마지막 열의 같은 일

(각각 왼쪽과 오른쪽 테두리) (자바 코드 만해야 호송 의미) :

for (int x = 1, x <= xmax; x++){ 
    for (int y = 1, y <= ymax; y++){ 
     // create the cell 
     PdfPCell cell = new PdfPCell(pr); 
     cell.setBorderWidth(0.0f); 
     cell.setBorderColorBottom(Color.LIGHT_GRAY); 
     // ... set the content of the cell here 
     // and change the border(s) width 
     if (x == 0) 
     cell.setBorderWidthLeft(0.1f); 
     if (x==xmax) 
     cell.setBorderWidthRight(0.1f); 
     if (y==0) 
     cell.setBorderWidthTop(0.1f); 
     if (y==ymax) 
     cell.setBorderWidthBottom(0.1f); 
     table.addCell(cell); 
    } 
} 

감사합니다.