How to include two pictures side by side in Markdown for IPython Notebook (Jupyter)?

依然范特西╮ 提交于 2019-11-26 19:41:33

问题


I am trying to insert two pictures side by side in one Markdown cell on a notebook. The way I do it was:

<img src="pic/scan_concept.png" alt="Drawing" style="width: 250px;"/> 

in order to be able to size the included picture. Can anyone gives suggestions on top of this?

Thanks,


回答1:


JMann's solution didn't work for me. But this one worked

from IPython.display import HTML, display
display(HTML("<table><tr><td><img src='img1'></td><td><img src='img2'></td></tr></table>"))

I took the idea from this notebook




回答2:


You can create tables using pipes and dashes like this.

A | B
- | - 
![alt](yourimg1.jpg) | ![alt](yourimg2.jpg)

see Tables syntax




回答3:


I found the following works in a Markdown cell:

    <tr>
    <td> <img src="Nordic_trails.jpg" alt="Drawing" style="width: 250px;"/> </td>
    <td> <img src="Nordic_trails.jpg" alt="Drawing" style="width: 250px;"/> </td>
    </tr>



回答4:


I don't have enough reputation to add comments, so I'll just put my 2 cents as a separate answer. I also found that JMann's solution didn't work, but if you wrap his implementation with table tags:

<table><tr>
<td> <img src="Nordic_trails.jpg" alt="Drawing" style="width: 250px;"/> </td>
<td> <img src="Nordic_trails.jpg" alt="Drawing" style="width: 250px;"/> </td>
</tr></table>

then it works.



来源:https://stackoverflow.com/questions/33647774/how-to-include-two-pictures-side-by-side-in-markdown-for-ipython-notebook-jupyt

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!