// Define a few rows for(short rownum = (short)0; rownum < 30; rownum++) { HSSFRow r = s.createRow(rownum); for(short cellnum = (short)0; cellnum < 10; cellnum += 2) { HSSFCell c = r.createCell(cellnum); HSSFCell c2 = r.createCell(cellnum+1); c.setCellValue((double)rownum + (cellnum/10)); c2.setCellValue(new HSSFRichTextString("Hello! " + cellnum); } }//源代码片段来自云代码http://yuncode.net