Plugin: Markdown Table Formatter

Thanks, I'll have a look but not right now. I won't have access to my PC today and possibly tomorrow

Just pushed a new version 1.2.0:

2 Likes

This is such a wonderful plugin! The only thing I had been using the wysiwyg editor was for plugins and this is going to free me from that. Except...

Is there a way for the formater to help with column creation? I have tried adding the column in the first three rows and doing the format, but it didn't do anything. Is there something I'm missing?

A workaround is to go to the wysiwyg and add the column there. The only disadvantage of that is that it deletes blank rows.

Also, have you thought about adding an icon to the toolbar for formatting?

Thanks again!

You need to add something like this

|
|- <- the 2nd line must have at least one dash
|
|

Sorry, I'm not catching it. Here is what I am trying. (All failed attempts)

addnewcolumn

I want to add a fourth column. Eventually I can get the fourth column formatted after I add the first three rows completely. But what I'm looking for is to have the remaining pipes added down the whole table. Otherwise on a long table I have to add them all manually. It's obviously not a huge burden. I was just wondering if there was something I'm missing.

@whitewall, the template plugin is quite useful for a selection of skeleton tables. Then it's just Ctrl+Alt+I to paste your boilerplate table into a note, and from there to copy and paste a bunch of extra rows, or select and delete several rows as required.
For anything other than small tables though, I usually use the external editor facility (Typora here)โ€”it allows easy set up of the number of columns and rows, and the insertion/deletion of columns/rows without fuss. Much easier than CodeMirror for bigger tables.

Ah, right. I misunderstood you.
The plugin can only format valid tables, it won't add new columns.

1 Like

But it could be a great addition for those who are used to using similar functions with vim.

1 Like

Hi, @roman_r_m

Following your demo, it couldn't be formatted like how you show in the demo. Instead, it could only be formatted if - exists in the table.

Version:
Joplin: 2.4.6 (prod, win32)
Table Formatter Plugin: v1.2.2

See the gif for more info
table-formatter-testing

Thanks for this wonderful plugin!

That demo might be out of date.
The plugin can only format what's already a valid markdown table, which requires the 2nd row with dashes.

2 Likes

I just came across a cool library for handling markdown tables celldown. I thought it would be relevant for this plugin.

Thanks @CalebJohn looks very nice!

Unfortunately it doesn't seem to support multimarkdown tables (some users reported issues when trying to format such tables).

1 Like

Ah! There's always a catch!
Maybe one day we'll find our fully integrated rock solid table library :slight_smile:

1 Like

@roman_r_m This plugin is already super useful but I was wondering if it is possible to have the table be auto formatted. This way it doesn't have to be manually formatted every time the table is edited like what is done in this Obsidian plugin.

I wanted to keep it as lightweight as possible but I suppose I could add this as an option. I'll see what I can do, but no ETA.

3 Likes

For some reason I can't get this plugin to work

Joplin version 2.6.1, macbook intel silicon, plugin version 1.2.1. Any idea why?

Screen Recording 2022-02-10 at 1.17.46 PM

This isn't a valid table in markdown. I'm pretty sure Joplin won't render this as a table either.
The 2nd row must consists of cells whose only content are hyphens.

As @roman_r_m mentioned, and based on your example, you would need to format your table like this:

Line 1: | col1 | col2 | col3 |
Line 2: | ---- | ---- | ---- |
Line 3: ||||
Line 4: ||||

The "Format Table" option should work after doing that.

As an aside, it seems that the forum code block doesn't format tables properly.

| col1 | col2 | col3 |
| ---- | ---- | ---- | ; Note the forward slashes instead of pipes.
|      |      |      |
|      |      |      |
|      |      |      |
|      |      |      |

@roman_r_m I love this plugin. Thanks so much for making it. :+1:t2:

@roman_r_m @skwire

Totally understand, and agree - this plugin is wonderful :smiling_face_with_three_hearts:

The demo in the original post shows that you can format a table without the hyphens row.

So if this is "work as intended" (i.e. you must add a hyphens row for the plugin to work), I suggest replacing the demo at the top, to avoid future confusion