# Format Text

## Content

Editor provides options for formatting <span data-highlighted="true" data-vc="highlighted-text">XHTML</span> documents and their elements through the commands and style options available in **[EditorRibbon](https://developer.mescius.com/componentone/api/win/online-editor-net/dotnet-api/C1.Win.Editor.10/C1.Win.Editor.C1EditorRibbon.-ctor.html "https://developer.mescius.com/componentone/api/win/online-editor-net/dotnet-api/C1.Win.Editor.10/C1.Win.Editor.C1EditorRibbon.-ctor.html")**.

## Align text

Use the alignment commands in the **Paragraph** group of EditorRibbon to configure paragraph alignment.
![C1WinForms RichTextEditor paragraph alignment commands](https://cdn.mescius.io/document-site-files/images/c8989ae3-804c-4f29-b5ce-fe6b13c0a9e3/image-20260630.f9b3f7.png)
The following image shows document text with different alignment settings.
![C1WinForms RichTextEditor paragraph alignment commands demo](https://cdn.mescius.io/document-site-files/images/c8989ae3-804c-4f29-b5ce-fe6b13c0a9e3/image-20260630.9123af.png)

>type=note
> <span data-loadable-vc-wrapper="true" data-ssr-placeholder="Hm6N8:EfLS5:z8NN7:qz-Pe:OP-5u-3" data-ssr-placeholder-replace="Hm6N8:EfLS5:z8NN7:qz-Pe:OP-5u-3" class="">Note: Content aligns left by default.</span>

***

## Decorate Text

Use the [FindAndDecorate](/componentone/api/win/online-editor-net/dotnet-api/C1.Win.Editor.10/C1.Win.Editor.C1Editor.FindAndDecorate.html) method of the [C1Editor](/componentone/api/win/online-editor-net/dotnet-api/C1.Win.Editor.10/C1.Win.Editor.C1Editor.html) class to apply style attributes to text that matches a specified pattern.
The pattern can contain plain text or a regular expression. Style attributes can configure the background color, foreground color, and other formatting properties. Separate multiple style declarations with semicolons.
For example, matching occurrences of a name can be displayed with a blue background and beige text.

```auto
c1Editor1.FindAndDecorate("Nikola", null, "background-color:blue; color:beige;");
```

![C1WinForms RichTextEditor paragraph decorate text demo](https://cdn.mescius.io/document-site-files/images/c8989ae3-804c-4f29-b5ce-fe6b13c0a9e3/image-20260630.3ce1cf.png)
Use the [Styles](/componentone/api/win/online-editor-net/dotnet-api/C1.Win.Editor.10/C1.Win.Editor.Ribbon.StylesGroup.html) group in EditorRibbon to perform the following actions:

* Apply a predefined style.
* Create a custom style by selecting **Create New Style from Formatting**.
* Remove applied formatting by selecting **Clear All Formatting**.

The following image shows the predefined style options available in EditorRibbon.
![C1WinForms RichTextEditor paragraph decorate text styles](https://cdn.mescius.io/document-site-files/images/c8989ae3-804c-4f29-b5ce-fe6b13c0a9e3/image-20260630.e0ae3f.png)