# Is there a way to align, scale and put images right next to text?

**URL:** <https://forum.obsidian.md/t/is-there-a-way-to-align-scale-and-put-images-right-next-to-text/6037>\
**Category:** Basement\
**Created:** [September 22, 2020, 9:37pm UTC](https://forum.obsidian.md/t/is-there-a-way-to-align-scale-and-put-images-right-next-to-text/6037 "2020-09-22T21:37:15Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![Wet](https://forum.obsidian.md/letter_avatar_proxy/v4/letter/w/848f3c/32.png) [@Wet](https://forum.obsidian.md/u/Wet)\
**Post date:** [September 22, 2020, 9:37pm UTC](https://forum.obsidian.md/t/is-there-a-way-to-align-scale-and-put-images-right-next-to-text/6037/1 "2020-09-22T21:37:15Z")

</div>

Is there a way to align, scale and put images right next to text?

Cheers

---

<div class="post-metadata">

**Author:** ![sam.baron](https://forum.obsidian.md/user_avatar/forum.obsidian.md/sam.baron/32/20_2.png) [@sam.baron](https://forum.obsidian.md/u/sam.baron)\
**Post date:** [September 22, 2020, 10:01pm UTC](https://forum.obsidian.md/t/is-there-a-way-to-align-scale-and-put-images-right-next-to-text/6037/2 "2020-09-22T22:01:47Z")

</div>

No, not directly. There are a couple workarounds:

1. You can use an `<img>` html tag if the image is hosted publicly (not a local file).
2. You can use custom CSS to style all images.

Here’s a related feature request you might want to look over [https://forum.obsidian.md/t/resize-embedded-content/877](https://forum.obsidian.md/t/resize-embedded-content/877)

---

<div class="post-metadata">

**Author:** ![Wet](https://forum.obsidian.md/letter_avatar_proxy/v4/letter/w/848f3c/32.png) [@Wet](https://forum.obsidian.md/u/Wet)\
**Post date:** [September 22, 2020, 10:43pm UTC](https://forum.obsidian.md/t/is-there-a-way-to-align-scale-and-put-images-right-next-to-text/6037/3 "2020-09-22T22:43:18Z")

</div>

Thanks, that was useful to some extent.  
I adopted the custom CSS as seen below and came up with the idea to use a table to display the text right next to the picture.  
In principle this works, but the more text I type in cell 1, the more the table and the picture in cell 2 scale undesirably.

My question now: Is there a way to fix the column size of the table? Or some other workaround?  
As requested here as well: [Ability to resize columns in tables](https://forum.obsidian.md/t/ability-to-resize-columns-in-tables/1553)

```
First Header | Second Header
------------ | ------------
Content from cell 1 | Content from cell 2
Content in the first column | Content in the second column

```

.

```
.markdown-preview-view img {
 
  display: block;
  margin-top: 20pt;
  margin-bottom: 20pt;
  margin-left: auto;
  margin-right: auto;
  width: 40%; /* experiment with values */
  transition:transform 0.25s ease;
}

.markdown-preview-view img:hover {
    -webkit-transform:scale(1.8); /* experiment with values */
    transform:scale(2.35);
}
```

---

<div class="post-metadata">

**Author:** ![sam.baron](https://forum.obsidian.md/user_avatar/forum.obsidian.md/sam.baron/32/20_2.png) [@sam.baron](https://forum.obsidian.md/u/sam.baron)\
**Post date:** [September 22, 2020, 10:53pm UTC](https://forum.obsidian.md/t/is-there-a-way-to-align-scale-and-put-images-right-next-to-text/6037/4 "2020-09-22T22:53:34Z")

</div>

Your options are similar. Write html manually with style attributes or custom CSS that applies to all tables.

---

<div class="post-metadata">

**Author:** ![Wet](https://forum.obsidian.md/letter_avatar_proxy/v4/letter/w/848f3c/32.png) [@Wet](https://forum.obsidian.md/u/Wet)\
**Post date:** [September 22, 2020, 10:56pm UTC](https://forum.obsidian.md/t/is-there-a-way-to-align-scale-and-put-images-right-next-to-text/6037/5 "2020-09-22T22:56:44Z")

</div>

Unfortunately I can’t really code, I just adopt and adapt the stuff I find here.  
I was looking for something over on [https://www.w3schools.com](https://www.w3schools.com), but didn’t find anything regarding locked column size.

Do you have a resource or a concrete idea how such custom CSS would look like?

/edit: Think I found something. Reporting back in a second.

---

<div class="post-metadata">

**Author:** ![Wet](https://forum.obsidian.md/letter_avatar_proxy/v4/letter/w/848f3c/32.png) [@Wet](https://forum.obsidian.md/u/Wet)\
**Post date:** [September 22, 2020, 11:10pm UTC](https://forum.obsidian.md/t/is-there-a-way-to-align-scale-and-put-images-right-next-to-text/6037/6 "2020-09-22T23:10:58Z")

</div>

Hm yea, I just added

```
table {
  table-layout: fixed;
  width: 600px;
}

```

which fixes the issue.  
The problem is this does not work well with the image downscaling used in the “zoom picture when hovering” custom css.

Anyways, thank you.

---

<div class="post-metadata">

**Author:** ![sam.baron](https://forum.obsidian.md/user_avatar/forum.obsidian.md/sam.baron/32/20_2.png) [@sam.baron](https://forum.obsidian.md/u/sam.baron)\
**Post date:** [September 23, 2020, 12:16am UTC](https://forum.obsidian.md/t/is-there-a-way-to-align-scale-and-put-images-right-next-to-text/6037/7 "2020-09-23T00:16:40Z")

</div>

You can target the embed preview with `.markdown-embed`, so your CSS might look like this:

```auto
.markdown-embed table {
  table-layout: fixed;
  width: 300px;
}

```

---

<div class="post-metadata">

**Author:** ![Wet](https://forum.obsidian.md/letter_avatar_proxy/v4/letter/w/848f3c/32.png) [@Wet](https://forum.obsidian.md/u/Wet)\
**Post date:** [September 23, 2020, 12:33am UTC](https://forum.obsidian.md/t/is-there-a-way-to-align-scale-and-put-images-right-next-to-text/6037/8 "2020-09-23T00:33:24Z")

</div>

I see, that’s generally useful to know, but I meant something different, sorry for not expressing myself in greater detail.

With the custom CSS snipped, which scales images to a certain percentage, inside the table the image is being downscaled as well, which is not really optimal.  
I have a hard time imagine a workaround for this. Something like 100% scale in tables, everywhere else 40%. Correct me if I’m wrong.

Greetings

---

<div class="post-metadata">

**Author:** ![WhiteNoise](https://forum.obsidian.md/user_avatar/forum.obsidian.md/whitenoise/32/11_2.png) [@WhiteNoise](https://forum.obsidian.md/u/WhiteNoise)\
**Post date:** [April 1, 2023, 1:49pm UTC](https://forum.obsidian.md/t/is-there-a-way-to-align-scale-and-put-images-right-next-to-text/6037/9 "2023-04-01T13:49:55Z")

</div>

Closed on April 1, 2023, 1:49pm UTC


