java jxl,
分享于 点击 13937 次 点评:15
java jxl,
1、设置单元格的宽度:WritableSheet sheetWrite=writeWorkbook.createSheet(pdName,i);
sheetWrite.setColumnView(0, 4);//设置第一列的宽度为4
sheetWrite.setColumnView(1, 23);//设置第二列的宽度为23
2、设置字体
WritableFont fontNormal= new WritableFont(WritableFont.ARIAL,11);
WritableCellFormat cellFormat=new WritableCellFormat(fontNormal);
cellFormat.setAlignment(jxl.format.Alignment.LEFT);
cellFormat.setVerticalAlignment(jxl.format.VerticalAlignment.CENTRE);
cellFormat.setWrap(true);
label.setCellFormat(cellFormat);
sheetWrite.addCell(label);
3、单元格居右
Label label=new Label(column,row,labelValue);
WritableCellFormat cellFormat=new WritableCellFormat();
cellFormat.setAlignment(jxl.format.Alignment.RIGHT);
label.setCellFormat(cellFormat);
sheetWrite.addCell(label);
相关文章
- 暂无相关文章
用户点评