What I’m trying to do
I would like to be able to adjust the width of the columns because I don’t like default formatting.
I don’t like when certain cells get packed with text and have one word per line (which destroys readability), while cells in other columns have barely anything (lots of space wasted), yet both columns are identical in size.
I’d like to be able to adjust the width of the columns.
I suspect vanilla markdown does not support that, but maybe there are hacks or plugins that could help me achieve that?
Thanks!
This is very difficult topic and I don’t personally know any community plugins that achieve this. You can encode column width information using html:
<table style="width:100%">
<tr>
<th style="width:70%">Firstname</th>
<th>Lastname</th>
<th>Age</th>
</tr>
<tr>
<td>Jill</td>
<td>Smith</td>
<td>50</td>
</tr>
<tr>
<td>Eve</td>
<td>Jackson</td>
<td>94</td>
</tr>
</table>
(when you paste that code into Obsidian and press enter, the table is then rendered)
In the example html code the custom code is style="width:70%"
and I think you need to start the table with <table style="width:100%">
. You could convert your markdown table to html table using this web tool https://tableconvert.com/markdown-to-html and then use style="width:70%"
to customize column width. You can use Custom Frames community plugin or Web viewer to integrate web tools into Obsidian.
Google Docs can import and export markdown so you might want to have some hybrid Google Docs + Obsidian workflow when you want to primarily use Obsidian but occasionally use Google Docs to gain certain features like table customization. As I have written earlier this Google Docs hybrid workflow also allows full control when you want to print your notes.
Finally here is simple CSS example that customize table column widths globally in Obsidian:
.markdown-source-view {
--table-column-min-width: 30ch;
--table-column-max-width: 30ch;
}
When you try this code you will see that this solution may not be optimal hence tables are really difficult topic in Obsidian.