How to Set Cell Borders and Alignment in Excel ByRegan Pun March 31, 2024 Updated June 22, 2025 Share: Unlock the full potential of Excel customization by watching our tutorial, where you'll learn to effortlessly apply vibrant borders and precise alignments to your spreadsheets using C# and IronXL, enhancing both the functionality and aesthetic appeal of your data presentations. more... In this tutorial, we explore how to set cell borders and alignment in Excel using C# with IronXL and the Iron Software Drawing Library. After ensuring that the necessary packages are installed, we dive into the code. The tutorial demonstrates creating a new workbook and worksheet, and specifically focuses on customizing cell B2. We apply thick borders to the left and right sides of the cell, using aquamarine and coral colors, respectively. By running the project, we confirm that the cell's appearance in Excel matches our expectations. IronXL offers a variety of border styles such as thin, medium, thick, dotted, and more. Additionally, it supports multiple alignment options like General, Right, Top, and Left. These features allow for extensive customization of Excel worksheets. The tutorial concludes by encouraging viewers to try out the different border and alignment options available and offers a 30-day trial for those interested in experimenting further with the software.Further Reading: How to Set Cell Border and Alignment show less