6

I want to make the images inside the markdown table to have the same size. However, the image assets that I have are of different sizes. Thus I want to make a relative image size inside the cell of the table.

How can I make Fig 2 to look like Fig 1 without actually changing the size of image assets?

|     |     |     |     |     |
| :-: | :-: | :-: | :-: | :-: |
|     |     |     |     |     |
| 180 | 182 | 240 | 250 | 250 |
| <img src="assets/textbooks/180.jpg" width="100%"> | <img src="assets/textbooks/182.jpg" width="100%"> | <img src="assets/textbooks/240.jpg" width="100%"> | <img src="assets/textbooks/250-1.jpg" width="100%"> | <img src="assets/textbooks/250-2.jpg" width="100%"> |

Fig 1. Intended

(Same code but the actual image assets have the same size)

enter image description here

Fig 2. Current Output

(What I curretly have)

enter image description here

Jiho Choi
  • 1,083
  • 1
  • 10
  • 26
  • Possible duplicate of [Changing image size in Markdown](https://stackoverflow.com/questions/14675913/changing-image-size-in-markdown) – Brandon Dyer Mar 27 '19 at 14:44
  • Thanks for the comment. I also had checked the [post](https://stackoverflow.com/questions/14675913/changing-image-size-in-markdown). However, I couldn't find an answer for `relative cell size` for the markdown table – Jiho Choi Mar 27 '19 at 14:49
  • 1
    Unfortunately, this comes down to implementation. If the site you're using doesn't use Markdown that's designed to be responsive I don't see how this can be achieved. You may be stuck using absolute values for size. – Brandon Dyer Mar 27 '19 at 14:58
  • 1
    I understand, Thank you very much for your help. – Jiho Choi Mar 27 '19 at 15:02

1 Answers1

1

From https://stackoverflow.com/a/21242579/420802

With certain Markdown implementations (including Mou and Marked 2 (only macOS)) you can append =WIDTHxHEIGHT after the URL of the graphic file to resize the image. Do not forget the space before the =.

![](./pic/pic1_50.png =100x20)

You can skip the HEIGHT

![](./pic/pic1s.png =250x)

Edit:

Many markdown parsers allow HTML.

<img src="drawing.jpg" alt="drawing" width="200" />
Brandon Dyer
  • 1,316
  • 12
  • 21