How to control column width in tables

I have a 2-column table, with a narrow left column, and a wider right column. The right column will contain a good bit of text. I would like the left column to keep its width. while the right column is word wrapped in the width that’s left. What I get is an extremely narrow left column (approx 2 characters wide), with the rest of the width of the table being occupied by the right column.

Markup:

Kortart | Explanation
----------------|-------------
A50 | Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
A56 | Lorem ipsum dolor sit amet ...
A57 | Lorem ipsum dolor sit amet ...

What I get:

I would prefer for the left column to be wide enough to not word wrap at all, but I could live with the values (A50, A56 and so on) not to word wrap, while the heading word wraps into 2 lines.

I have tried the Advanced Table plug in with the same result. And I don’t seem to be able to find anything in the forums that solves this.

Is there any way to accomplish this? Either in the built in table markup or in the Advanced Tables markup?

Obsidian v.: 0.14.2
OS: Windows 10

Thank in advance
Jens

2 Likes

This?

| Kortart  <img width=50/> | Explanation |
|:-----------|---|
| A50      |  |
| A506      |  |

Angel

PS Your table works fine in reading mode, yes? Live preview renders oddly, but it is only a general preview mode…

2 Likes

Thank you. I’m new to Obsidian, and hadn’t realised that there’s a difference between Live Preview and Reading Mode. The problem indeed only exist in Live Preview.

Your suggestion with the img-tag doesn’t solve my problem. I tried it both in built-in tables and in Advanced Tables. I also tried it with different width values.

I guess I’ll have to live with Live Preview being weird for now, and see what happens. :slight_smile:

– Jens

1 Like

It seems that HTML no-break tags work in live preview:

<nobr>Kortart</nobr> | Explanation
----------------|-------------
A50 | Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
A56 | Lorem ipsum dolor sit amet ...
A57 | Lorem ipsum dolor sit amet ...

Renders as:

Angel

7 Likes

That’s brilliant! Thank you. And it works in Advanced Tables as well. :slight_smile:

1 Like

Welcome.

Angel

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.