EasyXLS

Cell alignment settings

EasyXLS™ library allows you to apply horizontal and vertical alignment to the text in the spreadsheet cells. The indentation, text orientation and text direction are formatting features that can also be set for Excel cells.

For better performances, the best option is to apply the alignment to the style of the cell, row, or column by using ExcelStyle class. But the formatting can also be applied directly to the cell, row, or column.

Horizontal alignment

In EasyXLS, you can set horizontal alignment for a cell. The available horizontal alignments are General, Left, Center, Right, Fill, Justify, Center across selection and Distributed alignment. The below source code sample shows how to apply Center alignment to a cell style from the Excel file.

C#.NET
VB.NET
C++
Java
PHP
ASP
VB6
VBS
Coldfusion
Python

Vertical alignment

In EasyXLS, you can set vertical alignment for a cell. The available vertical alignments are Top, Middle, Bottom, Justify and Distributed alignment. The below source code sample shows how to apply Bottom alignment to a cell style from the Excel file.

C#.NET
VB.NET
C++
Java
PHP
ASP
VB6
VBS
Coldfusion
Python

Indent

The indentation is available for specific horizontal alignments like Left, Right and Distributed alignment. The below source code sample shows how to set indentation for a cell style from the Excel file.

C#.NET
VB.NET
C++
Java
PHP
ASP
VB6
VBS
Coldfusion
Python

Available for: Professional, Excel Writer
Go to top

EasyXLS Excel libraries:

.NET
.NET Excel Library
full .NET version to import, export or convert Excel files
COM+ Excel Library
full COM+ version to import, export or convert Excel files
-
Java
Java Excel Library
full Java version to import, export or convert Excel files
Download EasyXLS™ Excel Library for .NET and Java

File formats:

Office 365
MS Excel 2021 - 2025
MS Excel 2007 - 2019
MS Excel 97 - 2003
XLSXXLSMXLSBXLS
XMLHTMLCSVTXT