Skip to content

Commit

Permalink
Created Style Rows and Columns (markdown)
Browse files Browse the repository at this point in the history
  • Loading branch information
igitur committed Oct 22, 2016
1 parent baba7c4 commit 53ee9b0
Showing 1 changed file with 27 additions and 0 deletions.
27 changes: 27 additions & 0 deletions Style-Rows-and-Columns.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
## Style Rows and Columns

![StyleRowsColumns.jpg](http://download-codeplex.sec.s-msft.com/Download?ProjectName=closedxml&DownloadId=154798 "StyleRowsColumns.jpg")

```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");
```

0 comments on commit 53ee9b0

Please sign in to comment.