2

I uploaded a jupyter notebook to github. There was a line of text in a cell that I had centered in the jupyter notebook. But on uploading to github, the line appeared with html tags. Here is the code:

<p style='text-align:center';> <b> text </b> </p> 

the line showed up as it is with "<p style='text-align:center';>" on uploading to github and nbviewer.

I tried

<center> <b> text </b> </center> 

which works in jpnb markdown but the line doesn't even show up on uploading the file to github.

The following works in github .md file but not in local jupyter notebook. And since I haven't uploaded to github, I can't say if it centers there or not.

<p align="center"><b>text</b></p> 

Is there a way to center text on both local jupyter notebook that works on uploading to jupyter notebook as well?

1
  • 1
    No, it is not possible. See the answer to Is it possible to have a table in the center in Github gist markdown? for a detailed explanation. It is debatable whether this is a duplicate of that (as this refers specifically to Jupiter Notebook), but the explanation of why its not possible for a simple Markdown table would apply here as well. Commented Mar 9, 2021 at 19:47

1 Answer 1

3

Try this in a markdown cell :

<div align="center"><b> Centered Text </b></div> 
Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.