Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Style border Excel using ClosedXML in C#

I have a table data in Excel

enter image description here

I want to apply style broder as image enter image description here

How to code script in C# using ClosedXML?

like image 409
Ly Thanh Ngo Avatar asked Jul 18 '26 22:07

Ly Thanh Ngo


1 Answers

Thank @Francois Botha! I try it and it work. :)

ws.Range("A1:D4").Style.Border.TopBorder = XLBorderStyleValues.Thin; ws.Range("A1:D4").Style.Border.InsideBorder = XLBorderStyleValues.Dotted; ws.Range("A1:D4").Style.Border.OutsideBorder = XLBorderStyleValues.Thin; ws.Range("A1:D4").Style.Border.LeftBorder = XLBorderStyleValues.Thin; ws.Range("A1:D4").Style.Border.RightBorder = XLBorderStyleValues.Thin; ws.Range("A1:D4").Style.Border.TopBorder = XLBorderStyleValues.Thin;

like image 159
Ly Thanh Ngo Avatar answered Jul 21 '26 17:07

Ly Thanh Ngo



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!