代码如下:
style = (HSSFCellStyle)workbook.CreateCellStyle();
font = (HSSFFont)workbook.CreateFont();
font.FontName = "MS Pゴシック";
font.FontHeightInPoints = 24;
font.Color = NPOI.HSSF.Util.HSSFColor.BLACK.index;
font.Boldweight = (short)FontBoldWeight.BOLD;
style.Alignment = HorizontalAlignment.CENTER; // 没有居中
style.SetFont(font);
style.FillBackgroundColor = NPOI.HSSF.Util.HSSFColor.PINK.index; // 背景颜色没有
HSSFCell cell = (HSSFCell)row.CreateCell(startCol);
cell.SetCellValue(text);
cell.CellStyle = style;
CellRangeAddress r = new CellRangeAddress(startRow, endRow, startCol, endCol);
sheet.AddMergedRegion(r);
请问如和设定合并单元格的背景颜色和对齐方式?
穷人,钱少,跪求~~~~~~~~~~~~~~~~~~~