作者:乔山办公网日期:
返回目录:excel表格制作
你可以参考下这个代码:
Workbook workbook=new HSSFWorkbook(); // 定义一个新的工作簿
Sheet sheet=workbook.createSheet("第一个Sheet页"); // 创建第一个Sheet页
Row row=sheet.createRow(1); // 创建一个行
Cell cell=row.createCell(1); // 创建一个单元格
cell.setCellValue(4);
// 设置单元格边e799bee5baa6e58685e5aeb9335框
CellStyle cellStyle=workbook.createCellStyle();
cellStyle.setBorderBottom(CellStyle.BORDER_THIN); // 底部边框
cellStyle.setBottomBorderColor(IndexedColors.BLACK.getIndex()); // 底部边框颜色
cellStyle.setBorderLeft(CellStyle.BORDER_THIN); // 左边边框
cellStyle.setLeftBorderColor(IndexedColors.GREEN.getIndex()); // 左边边框颜色
cellStyle.setBorderRight(CellStyle.BORDER_THIN); // 右边边框
cellStyle.setRightBorderColor(IndexedColors.BLUE.getIndex()); // 右边边框颜色
cellStyle.setBorderTop(CellStyle.BORDER_MEDIUM_DASHED); // 上边边框
cellStyle.setTopBorderColor(IndexedColors.BLACK.getIndex()); // 上边边框颜色
你用的是什么工具导出的excel?POI或者JXL么?那他们的文档中会有详细的属性设置的。
取消excel中文本框的边框的操作步骤:
1、选中需要取消边框的文本框;
2、单击绘图工具格式----文本轮廓----无轮廓即可,如图所示。