I'm trying to show a comparison between two photos in my README.md which is why I want to display them side-by-side. Here is how the two images are placed currently. I want to show the two Solarized color schemes side by side instead of top and bottom. Help would be much appreciated, thanks!
9 Answers
The easiest way I can think of solving this is using the tables included in GitHub's flavored markdown.
To your specific example it would look something like this:
Solarized dark | Solarized Ocean
:-------------------------:|:-------------------------:
 | 
This creates a table with Solarized Dark and Ocean as headers and then contains the images in the first row. Obviously you would replace the ...
with the real link. The :
s are optional (They just center the content in the cells, which is kinda unnecessary in this case). Also you might want to downsize the images so they will display better side-by-side.
Similar to the other examples, but using html sizing, I use:
<img src="image1.png" width="425"/> <img src="image2.png" width="425"/>
Here is an example
<img src="https://openclipart.org/image/2400px/svg_to_png/28580/kablam-Number-Animals-1.png" width="200"/> <img src="https://openclipart.org/download/71101/two.svg" width="300"/>
I tested this using Remarkable.
This is the best way to make add images/screenshots of your app and keep your repository look clean.
Create a screenshot
folder in your repository and add the images you want to display.
Now go to README.md
and add this HTML code to form a table.
#### Flutter App Screenshots
<table>
<tr>
<td>First Screen Page</td>
<td>Holiday Mention</td>
<td>Present day in purple and selected day in pink</td>
</tr>
<tr>
<td><img src="screenshots/Screenshot_1582745092.png" width=270 height=480></td>
<td><img src="screenshots/Screenshot_1582745125.png" width=270 height=480></td>
<td><img src="screenshots/Screenshot_1582745139.png" width=270 height=480></td>
</tr>
</table>
In the <td><img src="(COPY IMAGE PATH HERE)" width=270 height=480></td>
** To get the image path --> Go to the screenshot
folder and open the image
and on the right most side, you will find Copy path
button.
You will get a table like this in your repository--->
If, like me, you found that @wiggin answer didn't work and images still did not appear in-line, you can use the 'align' property of the html image tag and some breaks to achieve the desired effect, for example:
# Title
<img align="left" src="./documentation/images/A.jpg" alt="Made with Angular" title="Angular" hspace="20"/>
<img align="left" src="./documentation/images/B.png" alt="Made with Bootstrap" title="Bootstrap" hspace="20"/>
<img align="left" src="./documentation/images/C.png" alt="Developed using Browsersync" title="Browsersync" hspace="20"/>
<br/><br/><br/><br/><br/>
## Table of Contents...
Obviously, you have to use more breaks depending on how big the images are: awful yes, but it worked for me so I thought I'd share.
This solution allows you to add space in-between the images as well. It combines the best parts of all the existing solutions and doesn't add any ugly table borders.
<p align="center">
<img alt="Light" src="https://...light.png" width="45%">
<img alt="Dark" src="https://...dark.png" width="45%">
</p>
The key is adding the
non-breaking space HTML entities, which you can add and remove in order to customize the spacing.
You can see this example live on GitHub here.
To piggyback off of @Maruf Hassan
# Title
<table>
<tr>
<td>First Screen Page</td>
<td>Holiday Mention</td>
<td>Present day in purple and selected day in pink</td>
</tr>
<tr>
<td valign="top"><img src="screenshots/Screenshot_1582745092.png"></td>
<td valign="top"><img src="screenshots/Screenshot_1582745125.png"></td>
<td valign="top"><img src="screenshots/Screenshot_1582745139.png"></td>
</tr>
</table>
<td valign="top">...</td>
is supported by GitHub Markdown. Images with varying heights may not vertically align near the top of the cell. This property handles it for you.
For markdown table syntax see:
https://www.markdownguide.org/extended-syntax/#tables
Quick summary:
To quickly understand the syntax used in other answers, it helps to start from a more complete intuitive and easier to remember syntax, and then a minimalized version with the same result.
Basic example:
| Header A | Header B |
| -------------- | -------------- |
| row 1 col 1 | row 1 col 2 |
| row 2 column 1 | row 2 column 2 |
Same result in a more minimalist form (cell widths can vary) :
Header A | Header B
--- | ---
row 1 col 1 | row 1 col 2
row 2 column 1 | row 2 column 2
And more related to the question: side by side images with labels on top:
label 1 | label 2
--- | ---
 | 
( use :---
, ---:
, and :---:
for (text) alignment in the column, respectively: left, right, center )