Achieving center alignment in your article is simple with the 'Align center' option in the toolbar of the WYSIWYG editor. However, in the Markdown editor, all text defaults to left alignment.

To center align text in the Markdown editor, follow the workaround below.

Solution

  1. Go to the desired article in the Knowledge base portal.
  2. Paste the below code in the desired location where you want the text to appear.
<p style="text-align: center;">Text_content</p>
  1. Replace the 'Text_content' with your desired text.

For example:

<p style="text-align: center;">Sample text with center alignment</p>
  1. The output would be as below

Sample text with center alignment

Note

You can add the basic text formatting such as bold, italic, and strikethrough using the usual syntax for the entire code.

For example,

***<p style="text-align: center;">Text with basic formatting applied</p>***

Output:

Text with basic formatting applied

How to 'Right align' text in Markdown editor?

If you want the text to be right aligned, use the following code.

<p style="text-align: right;">Text_content</p>

Center align Headings in Markdown

You can also center-align Headings in your article by slightly altering the HTML code snippet.
Replace the <p>...</p> with <h2>...</h2>, <h3>...</h3>, or <h4>...</h4>.

For example, to center align a H3

<h3 style="text-align: center;">H3 that is center aligned</h3>

Output:

H3 that is center aligned