Alignment
By the Syncfusion DevTutorials team · Last updated
Align text left, center, and right, set vertical alignment, wrap long text, merge cells, and angle text.
The position of text inside a cell can make a worksheet much easier to read. Centered headings, neatly wrapped notes, and titles that span multiple columns all rely on alignment features. In this lesson, you'll learn how to align text horizontally and vertically, wrap long text, merge cells, and rotate text.
Open the Excel sandbox and follow along. The alignment tools are located in the Alignment group on the Home tab.
Left Alignment
Left alignment places content against the left edge of a cell. It is the default alignment for most text entries and works best for names, labels, and descriptions.
To apply left alignment:
- Select the cells.
- Click Align Left.
Center Alignment
Center alignment positions content in the middle of a cell.
It is commonly used for:
- Column headings
- Short codes
- Yes/No fields
- Titles within a table
To apply center alignment:
- Select the cells.
- Click Center.
Right Alignment
Right alignment places content against the right edge of a cell. It is the default alignment for numbers, allowing values to line up neatly for comparison.
To apply right alignment:
- Select the cells.
- Click Align Right.
It is also a good practice to right-align number-related headings so they align visually with the data beneath them.
A simple guideline is: text on the left, numbers on the right, and headings aligned appropriately above their data. Avoid centering columns of numbers because it makes values harder to compare.
Vertical Alignment
When a row is taller than its contents, vertical alignment determines where the content appears within the cell.
Available options include:
- Top Align
- Middle Align
- Bottom Align
To change vertical alignment:
- Select the cells.
- Choose Top Align, Middle Align, or Bottom Align.
Middle Align is often used for larger heading rows because it creates a balanced appearance.
Wrap Text
Long text may extend into neighboring cells or become hidden. Wrap Text displays the content on multiple lines within the same cell.
To wrap text:
- Select the cells.
- Click Wrap Text on the Home tab.
Excel automatically increases the row height to display all lines.
To insert a line break at a specific position while typing:
- Press Alt + Enter inside the cell.
Merge Cells
Merging combines multiple cells into a single larger cell.
This feature is commonly used for worksheet titles that span several columns.
To merge cells:
- Select the cells you want to combine, such as A1:D1.
- Click Merge & Center.
Additional merge options may also be available, including:
- Merge & Center
- Merge Across
- Merge Cells
When cells are merged, only the content from the top-left cell is retained. Any content in the other selected cells is removed. Only merge cells when the remaining cells are empty or contain no important data.
Unmerge Cells
To separate merged cells:
- Select the merged cell.
- Click Merge & Center again or choose Unmerge Cells.
Merged cells can interfere with sorting, filtering, and other data-management features. Use merged cells for worksheet titles rather than within the main data area.
Text Orientation
Text Orientation allows text to be displayed at an angle or vertically, which can help fit long headings into narrow columns.
To change text orientation:
- Select the cells.
- Click Orientation in the Alignment group.
Choose an option, such as:
- Angle Counterclockwise
- Vertical Text
- Rotate Text Up
- Rotate Text Down
If orientation options are unavailable in the sandbox, use Wrap Text to display long headings within narrow columns.
Common mistakes
| Mistake | Result | Solution |
|---|---|---|
| Merging cells that contain data | Only the top-left value remains | Undo the merge and move the data first |
| Centering a column of numbers | Values become difficult to compare | Right-align the numbers |
| Wrapping text while keeping a fixed row height | Some text becomes hidden | AutoFit the row height |
| Using spaces to position text | Alignment changes when column widths change | Use alignment tools instead |
| Merging cells inside a table | Sorting and filtering may not work correctly | Unmerge the cells and use a separate title row |
Exercise
Click Reset in the sandbox header and enter the following data:
- A1:
Team Contacts - A2:
Name, B2:Phone, C2:Notes - A3:
Lina, B3:5551234, C3:Prefers email in the morning, calls after 2 pm
Then complete each task and click Check.
What to Remember
- Keep text left-aligned and numbers right-aligned.
- Center alignment is useful for headings and short labels.
- Vertical alignment controls whether content appears at the top, middle, or bottom of a cell.
- Wrap Text displays long entries on multiple lines within a cell.
- Merge & Center combines cells for titles and keeps only the top-left value.
- Avoid using merged cells within worksheet data because they can interfere with sorting and filtering.
- Text Orientation can rotate text to fit long headings into narrow columns.
In the next lesson, you'll learn how to format numbers as currency, percentages, dates, and other data types.