# Formatting Text and Cells

## Font Settings

There is a set of buttons in the **Font** section that allow you to modify the default formatting and apply new font color, style and size as well as change the appearance of a cell - set the background color and apply a new type and color for borders.

![Font section](/files/LNfeuNsTNaV2SCNc1TBY)

* To apply a different font, click **Font family** and select a suitable font from the list.
* To change the size of a font, click **Font size** and choose the size you need.
* To make the content of the cell bold, italic, underlined or strikethrough use the corresponding buttons.
* To change the font and background colors, use color pickers attached to the related buttons.
* To style and color cell borders, make use of the **Borders** button.

### Styling Cell Borders

You can set borders for cells and adjust their appearance in the corresponding popup that opens on clicking the **Borders** button.

![Cell borders popup](/files/dEEFAUijNDf7dk9ukcOM)

SpreadSheet provides all border types available in Excel:

* hair
* dotted
* dashDotDot
* dashDot
* dashed
* thin
* mediumDashDotDot
* slantDashDot
* mediumDashDot
* mediumDashed
* medium
* thick
* double

![Cell border types](/files/2fWY9iN9y7k7xR372bRF)

To adjust the styling of the border of a cell: select (in any order) the position of the border, choose its color and type, and click the **Apply** button.

<figure><img src="/files/AyxDfZy0Ll392hbkOkwJ" alt="Styling Cell Borders" width="664"><figcaption></figcaption></figure>

## Aligning Cell Content

You can align the content of a cell in several ways.

* To align cell content **horizontally**:
  * Click the **Horizontal align** button in the **Align** section
  * Select the necessary type of horizontal alignment: **Left align/Center align/Right align**

![Horizontal Align](/files/-LEUKH9-9hBU0aZ3fohm)

* To align cell content **vertically**:
  * Click the **Vertical align** button in the **Align** section
  * Select the necessary type of vertical alignment: **Top align/Middle align/Bottom align**

![Vertical Align](/files/-LEUKH91MqbGQX-1rBXq)

* To wrap long text to present it on multiple lines in a cell:
  * Select the cell with text you want to wrap
  * Click the **Text wrap** button in the **Align** section

![Text Wrap](/files/-LEUKH93Tl9dGp-KIPp0)

Text is wrapped automatically to fit the column width.

### **Indent Text Within Cells**

You can indent the contents of the cell so that it can be moved away from the left/right border. To do it, click on the corresponding **Increase indent** and **Decrease indent** buttons in the **Align** section.

![Text Indent](/files/8Kz8kWwUUU6b1HibOv8A)

## Clear Formatting

You can discard the applied formatting in two ways:

1\) Select necessary cell/cells with formatting.

2\) Click the **Clear** button in the **Edit** section of the toolbar.

3\) Select the *Clear styles* option in the dropdown list.

![Clear Formatting via Toolbar](/files/-LEUKH95ZpkGK5gc2s_T)

Or:

1\) Select necessary cell/cells with formatting.

2\) Right-click the selected cell/cells to call the context menu.

3\) Select *Clear*->*Styles*.

![Clear Cell Formatting via Context Menu](/files/-LEUthHA3FqsFk-1jvCI)

## Merging Cells

Cells merging allows you to combine neighboring cells into one large cell.

For example, you can add a common header for several columns. Have a look at the example below:

*Merging cells A1-D1 to make a header for a table*

![Table Header](/files/-LEUKH99hpZJQhExfesa)

To merge several adjacent cells, you need to:

1\) Copy data from the cells you want to merge into some other place on the sheet, since it will be deleted after merging.

2\) Select the necessary cells and click the **Merge** button in the **Align** section.

![Merge Button](/files/-LFIIS2HnMrjtWSZiXB9)

3\) Double-click the new big cell and type the desired text.

4\) Optionally, click the **Horizontal align** button and apply *Center align* to the cell to center the text.

![Centering Text](/files/-LFIIS2KBGMZVxD4IkeO)

### Splitting Merged Cell

To split a merged cell:

* Select the merged cell that should be split into several cells.
* Click the **Merge** button.

### Styles Merging Behavior

* Spreadsheet applies the style of the top-left cell to all merged cells.
* When setting styles via the toolbar or menu, Spreadsheet applies them to all cells in the merge.
* If the cells have borders before merging, Spreadsheet removes the inner borders and applies the outer borders based on the borders set on the perimeter.

For example:

![Merging borders](/files/lsBBIqeMioheRcZXEs6R)

On merging the cells, Spreadsheet applies styling as shown below:

![Merged borders](/files/T8shOZnmWyeyzskVXGXL)

* Cell borders can be solid or dashed. If you apply mixed solid and dashed borders to cells in a range, Spreadsheet uses the first border type it encounters during merging.

For example:

![Merging styled borders](/files/orsa8r0dvV34OtiYNPTh)

The result of merging cells with different border types is the following:

![Merged styled borders](/files/iCXQNh7MnNLMJp2ECgNv)

## Conditional Cells Formatting

You can set a special format for a cell/cells the values of which correspond to a particular condition or several conditions at once.

In the example below, cells the values of which are greater than 800 are highlighted in the light orange color. The cells with values less than 8000 are colored in green and their font color changed to yellow:

![Formatted Cells](/files/-LF1lKLdWdg4CQutgk4h)

To apply specific styling to cells, depending on their values:

1\) Select the range of cells you want to format.

2\) Click the **Conditional format** button in the **Edit** section of the toolbar.

![Conditional Format Button](/files/-LF1lKLfHkgq9hr03kZA)

3\) In the opened popup set the conditions (you can set up to three of them at once):

* Use the style selector to decide on what the cell will look like when conditions are met.
* Choose a condition for comparison (>, <, =, *not equal*, or *between*).
* Add the value to compare with.

![Conditional Format Popup](/files/-LF1qtzpXuw-HYPNX3xB)

4\) Click the **Apply** button.

> **Note**
>
> Pay attention that in case some of conditions intersect, only the last of them will be applied.

### Removing Conditional Formatting

To remove conditional formatting from formatted cells:

1\) Select necessary cell/cells.

2\) Click the **Clear** button in the **Edit** section of the toolbar.

3\) Select the *Clear conditional formats* option in the dropdown list.

![Clear Conditional Formatting via Toolbar](/files/-LFIIS2moVTCEYEbFP4w)

Or:

1\) Select necessary cell/cells.

2\) Right-click the selected cell/cells with conditional formatting to call the context menu.

3\) Select *Clear*->*Conditional formats*.

![Clear Conditional Formatting via Context Menu](/files/-LFIIS2qUuL45k23-UIR)


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://webix-guides.gitbook.io/spreadsheet-user-guide/formatting_cells.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
