3

有没有办法使用 JXL 为一系列单元格添加边框?一次为一个单元格设置边框非常繁琐。选择一系列单元格并合并它们是可行的,但不确定如何一次为一堆单元格设置边框。

4

2 回答 2

0

有一种方法,先合并单元格,然后为一个单元格添加边框

sheet.mergeCells(ColumnX, rowX, columnY, rowX);
WritableCellFormat cellFormat = new WritableCellFormat();
cellFormat.setBorder(Border.ALL, BorderLineStyle.THIN);
jxl.write.Label lab11 = new jxl.write.Label(columnX, rowX, "Label", cellFormat);
smrysheet.addCell(lab11); 
于 2017-09-29T03:15:00.240 回答
-1

使用 WritableCellFormat

WritableCellFormat cellFormat = new WritableCellFormat();
cellFormat.setBorder(Border.ALL, BorderLineStyle.THIN);
Label label = new Label(col, row, desc, cellFormat);
sheet.addCell(label);
于 2017-02-07T08:35:00.377 回答