Solution 1 :

You can use something like this in a jupyter cell:

%%html
<div>
    <span style="float: left; width: 33%; text-align: left;">Word1</span>
    <span style="float: left; width: 33%; text-align: center;">Word2</span>
</div>

EDIT: sorry missed the markdown aspect. For markdown remove the %%html magic, so just this:

<div>
    <span style="float: left; width: 33%; text-align: left;">Word1</span>
    <span style="float: left; width: 33%; text-align: center;">Word2</span>
</div>

This works because markdown is a subset of html.

Problem :

I am trying to have two words in a markdown cell in Jupyter, one word left-aligned and one word in the center. The most intuitive way to do this is # word 1 <center> word 2 </center>. However, the center tag also places word 2 in the vertical center of the cell, so the end result has word 1 and word 2 on different lines. Is there a way to center word 2 without this undesired effect? Thanks!

By

Leave a Reply

Your email address will not be published. Required fields are marked *