关于NPOI中设置Excel单元格样式的说明

// 在Excel工作簿中创建单元格样式
ICellStyle cellStyle = workbook.CreateCellStyle();
// 在Excel工作簿中创建字体
IFont font = workbook.CreateFont();
// 设置字体参数
font.IsBold = true;
// 设置样式参数
cellStyle.SetFont(font);
// 获取行
IRow row = sheet.CreateRow(0);
// 获取单元格
ICell cell = row.GetCell(0);
// 设置单元格样式
cell.CellStyle = cellStyle;

发表回复