-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Created Style Rows and Columns (markdown)
- Loading branch information
Showing
1 changed file
with
27 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
## Style Rows and Columns | ||
|
||
 | ||
|
||
```c# | ||
var workbook = new XLWorkbook(); | ||
var ws = workbook.Worksheets.Add("Style Rows and Columns"); | ||
|
||
//Set the entire worksheet's cells to be bold and with a light cyan background | ||
ws.Style.Font.Bold = true; | ||
ws.Style.Fill.BackgroundColor = XLColor.LightCyan; | ||
|
||
// Set the width of all columns in the worksheet | ||
ws.Columns().Width = 5; | ||
|
||
// Set the height of all rows in the worksheet | ||
ws.Rows().Height = 20; | ||
|
||
// Let's play with the rows and columns | ||
ws.Rows(2, 3).Style.Fill.BackgroundColor = XLColor.Blue; | ||
ws.Columns(3, 4).Style.Fill.BackgroundColor = XLColor.Orange; | ||
ws.Rows(5, 5).Style.Fill.BackgroundColor = XLColor.Pink; | ||
ws.Row(6).Style.Fill.BackgroundColor = XLColor.Brown; | ||
ws.Column("E").Style.Fill.BackgroundColor = XLColor.Gray; | ||
|
||
workbook.SaveAs("StyleRowsColumns.xlsx"); | ||
``` |