[PYTHON] Display HTML in Jupyter notebook

When you want to display HTML in the output in Jupyter notebook, google variously,


from IPython.display import HTML
HTML("<h1>Test</h1>")
HTML("<h2>test<h2>")

If you find that it's OK, but it doesn't work, you may be able to work by enclosing HTML in display as shown below.

from IPython.display import display, HTML
display(HTML("<h1>Test</h1>"))
display(HTML("<h2>test<h2>"))

image.png

end

Recommended Posts

Display HTML in Jupyter notebook
Multiprocessing error in Jupyter Notebook
Automatically save .py and .html files in Jupyter notebook.
Generate Jupyter notebook ".ipynb" in Python
Embed your favorite HTML in Jupyter
View graphs inline in Jupyter Notebook
[Memo] Display Jupyter Notebook on PC in monospaced font (Mac)
Unable to display tensorboard in jupyter notebook on docker (solved)
View dynamic graphs in Jupyter notebook. (Inline display of D3.js)
Jupyter Notebook memo
Introducing Jupyter Notebook
Memory leak in Python Jupyter Lab (Notebook)?
Powerful Jupyter Notebook
How to execute commands in jupyter notebook
Bash in Jupyter
Display histogram / scatter plot on Jupyter Notebook
Jupyter notebook password
Jupyter Notebook memo
[Jupyter Notebook memo] Display kanji with matplotlib
Allow Jupyter Notebook to embed audio data in HTML tables for playback
Install matplotlib and display graph on Jupyter Notebook
When Html cannot be output with Jupyter Notebook
In Django, display batch (command) results sequentially in HTML
Receive and display HTML form data in Python
Browser specification of Jupyter Notebook in Windows environment
Simply display a line graph on Jupyter Notebook
Error running Jupyter Notebook in Anaconda virtual environment
3 Jupyter notebook (Python) tricks
Jupyter in Cloud9 IDE
[Cloud103] # 3 Jupyter Notebook again
Drawing a tree structure with D3.js in Jupyter Notebook
Shortcut key for Jupyter notebook
Introduced Jupyter Notebook to CentOS 7
Using Graphviz with Jupyter Notebook
Machine learning with Jupyter Notebook in OCI Always Free environment (2019/12/17)
How to import NoteBook as a module in Jupyter (IPython)
Use pip with Jupyter Notebook
Display UTM-30LX data in Python
About the garbled Japanese part of pandas-profiling in Jupyter notebook
Display PIL images on Jupyter
Settings often used in Jupyter
Try using Jupyter Notebook dynamically
Reflect the virtual environment created with Miniconda in Jupyter notebook
Opens in a new window when launching Jupyter Notebook (Windows)
[Super Basics] About jupyter Notebook
High charts on Jupyter notebook
View PDF on Jupyter Notebook
Use Cython with Jupyter Notebook
homebrew, pyenv, anaconda, Jupyter Notebook
Play with Jupyter Notebook (IPython Notebook)
[Complete version] Jupyter Notebook shortcut
Write charts in real time with Matplotlib on Jupyter notebook
Display Japanese in JSON file
How to import NoteBook as a module in Jupyter (IPython)
Run Jupyter Notebook on windows
Automatically opens in a new window when launching Jupyter Notebook
How to use Jupyter Notebook
python3.8 venv environment jupyter notebook
Embed wav files in Jupyter
How to resolve ModuleNotFoundError: No module named XXX in Jupyter Notebook
Git management of Jupyter notebook (ipynb) differences in easy-to-read with JupyterLab