Row firstRow = sheet.createRow(0); //第一行
Row secondRow = sheet.createRow(1); //第二行
Row thirdRow = sheet.createRow(2); //第三行
CellStyle style =wb.createCellStyle();
Font f = wb.createFont();
// f.setFontHeightInPoints((short) 16);//字号
f.setFontHeightInPoints((short) 12);//字号
// f.setBoldweight(HSSFFont.BOLDWEIGHT_NORMAL);//加粗
f.setBoldweight(HSSFFont.BOLDWEIGHT_NORMAL);
style.setFont(f);
style.setAlignment(HSSFCellStyle.ALIGN_CENTER);//左右居中
style.setBorderBottom(HSSFCellStyle.BORDER_THIN);//下边框
style.setBorderTop(HSSFCellStyle.BORDER_THIN);//上边框
style.setBorderLeft(HSSFCellStyle.BORDER_THIN);//左边框
style.setBorderRight(HSSFCellStyle.BORDER_THIN);//右边框
百度:poi excel 合并单元格
以前做过没做笔记 都 是百度的。。。
http://piranha.iteye.com/blog/829574
看看这个?
我只做过导出,没用过跨列
sheet.mergeCell() 方法
尝试用jxl或poi自带的一些功能做;这两个技术的参考文章:
http://blog.csdn.net/tianyazaiheruan/article/details/9818391
http://blog.csdn.net/tianyazaiheruan/article/details/12555395