合并单元格时,只有第一格边框可以设置成为黑色,是怎么回事?

解决方案 »

  1.   

    我的代码:
    HSSFCellStyle cs1 = wb.createCellStyle();
    cs1.setBorderBottom(HSSFCellStyle.BORDER_THIN);
    cs1.setBorderLeft(HSSFCellStyle.BORDER_THIN);
    cs1.setBorderRight(HSSFCellStyle.BORDER_THIN);
    cs1.setBorderTop(HSSFCellStyle.BORDER_THIN);

    HSSFRow titlerow = sheet.createRow(rowIndex);
    titlerow.setHeight((short)0x200);
    HSSFCell titlecell = titlerow.createCell((short)0);
    titlecell.setEncoding(HSSFCell.ENCODING_UTF_16);
    titlecell.setCellValue(title);
    sheet.addMergedRegion(new Region((short)0,(short)0,(short)0,(short)10));
    titlecell.setCellStyle(cs1);按理说合并成大单元格后应该四周有边框才对,但现在出不来,我到底哪里写错啦?