using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using NPOI.HSSF.UserModel;
using NPOI.SS.Formula.Eval;
using NPOI.SS.Formula.Functions;
using NPOI.SS.UserModel;
using NPOI.XSSF.UserModel;
using NPOI.POIFS.FileSystem;
using NPOI.HPSF;
using System.IO;
using NPOI.SS.Util;
using System.Drawing;
using NPOI.HSSF.Util;
namespace NPOI
{
class Program5
{
static void Main(string[] args)
{
//说明:设置单元格边框
//1.创建EXCEL中的Workbook
IWorkbook myworkbook = new XSSFWorkbook();
//2.创建Workbook中的Sheet
ISheet mysheet = myworkbook.CreateSheet("sheet1");
//3.创建Row中的Cell并赋值
IRow row0 = mysheet.CreateRow(0); row0.CreateCell(0).SetCellValue(""); row0.CreateCell(1).SetCellValue("Thin");
IRow row1 = mysheet.CreateRow(1); row1.CreateCell(0).SetCellValue(""); row1.CreateCell(1).SetCellValue("Medium");
IRow row2 = mysheet.CreateRow(2); row2.CreateCell(0).SetCellValue(""); row2.CreateCell(1).SetCellValue("Dashed");
IRow row3 = mysheet.CreateRow(3); row3.CreateCell(0).SetCellValue(""); row3.CreateCell(1).SetCellValue("Dotted");
IRow row4 = mysheet.CreateRow(4); row4.CreateCell(0)
NPOI2.2.0.0实例详解(六)—设置EXCEL单元格边框
最新推荐文章于 2023-12-20 14:54:57 发布
![](https://img-home.csdnimg.cn/images/20240711042549.png)