ClosedXML New Workbook Styles All Sheets

Viewed 7266

I just got started with ClosedXML. When I create a new workbook with the code below, it automatically applies "Blue, Table Style Light 9" to each worksheet. I don't want any style on the worksheets. How do I specify no style?

XLWorkbook wb = new XLWorkbook();
wb.Worksheets.Add(dt, "sheet1");

I'm just basically filling the sheet with a SQL datatable.

3 Answers

To add a dt without a Theme use the following code:

var ws = wb.Worksheets.Add("SheetName");
ws.FirstCell().InsertTable.InsertTable(dt).Theme = XLTableTheme.None;;
Related