Centering Text in IPython notebook markdown/heading cells?

You can actually use the markdown mode for the cell and use the normal HTML code, as in

<h1><center>Centered text!</center></h1>

Knowing that in jupyter (ipython) notebook markdown cells the title level is identified by the number of # (# for top level headings or h1, ## for h2, ....), I use the following combination of HTML and markdown:

# <center>Your centered level h1 title</center>

## <center>Your centered level h2 title</center>

etc..

It's straightforward and the easiest to remember but please do comment if there's any disadvantage in doing so.

Tested in jupyter version 4.4.0 (not sure about other version but no reason it doesn't work).


Not directly with markdown i think, but you can just enter HTML in the markdown cells:

<h3 align="center">This is a centered header</h3>