HSSFCell cell = null;
HSSFRow row = sheet.createRow(0);
HSSFRichTextString h0 = new HSSFRichTextString("加边框");
cell = row.createCell((short) 0);
cell.setCellValue(h0);
就给我上面这个单元格加个就行,就只加边框,请不要复制网上查的 谢谢.

解决方案 »

  1.   


    ....
    cell = row.createCell((short) 0);
    cell.setCellValue(h0);
             
    HSSFCellStyle style = workbook.createCellStyle();       
               style.setBorderBottom((short)2);//下边框     
               style.setBorderLeft((short)2);//左边框     
               style.setBorderRight((short)2);//右边框     
               style.setBorderTop((short)2);//上边框     
               cell.setCellStyle(style);   lz用的poi