var workbook = Workbook.Create("test.xlsx" ) // Get the first worksheet. A workbook contains at least 1 worksheet. var cellWorksheet = workbook.Worksheets[ 0 ]; // Set cell content and Border styles. cellWorksheet.Cells[ "C5" ].Value = "Bottom"; cellWorksheet.Cells[ "C5" ].Style.Borders[ BorderType.Bottom ].Style = LineStyle.Double; cellWorksheet.Cells[ "C5" ].Style.Borders[ BorderType.Bottom ].Color = Color.Red; cellWorksheet.Cells[ "C8" ].Value = "Top"; cellWorksheet.Cells[ "C8" ].Style.Borders[ BorderType.Top ].Style = LineStyle.DashDot; cellWorksheet.Cells[ "C11" ].Value = "Right"; cellWorksheet.Cells[ "C11" ].Style.Borders[ BorderType.Right ] = new Border() { Style = LineStyle.MediumDashed, Color = Color.Green }; // Save workbook to disk. workbook.Save();
Target Platforms: Windows 11, Windows 10, Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2