Convert list to table

Hello,

I found a plugin Any Block and the idea of converting a list to a table by adding command over it is really nice! But it’s an old and buggy plugin. Mainly it did not show in reading mode. Is there any similar plugin that does this?

Thanks.

3 Likes

I wanted to do the same thing, but could not find a plugin so i switched to vscode and used a plugin there to do the job then switched back to obsidian. Job done! The vscode plugin was called “Markdown Table”. It must have been written in javascript as all vscode plugins are so it would seem possible to port it to obsidian but i don’t know how to do that. But there are many people on here who do.

Try MarkMind(free version) plugin

I use it mainly to toggle between markdown & mind map

but you could use it to get a table

markmind docs

1 Like

Hey guys! I just had a similar problem where I wanted to turn a list of something (just lots of new lines after each other) into the start of a table, and I didn’t find a good way to do it, so I made a solution myself. This works great together with the obsidian hotkey “Toggle bullet list”. I wish there was a similar “Toggle table” hotkey. (If you have an actual bullet lits, your steps would be 1) Toggle bullet list, 2) turn list into table using my solution.)

So here is my solution:

; AltGr + t = turn list into markdown table
<^>!t::
Send, ^c
ClipWait, 1
text := Clipboard ; gets text
newText := "  |  `n--|--`n" ; Adding the header lines
Loop, Parse, text, `n, `r
{
    ; Append " | " at the end of each line
    newText .= A_LoopField " | `n"
}
StringTrimRight, newText, newText, 1
Clipboard := newText
Send, ^v ; sends table
return

It is an AutoHotkey-script that copies the text you have marked, adds the markdown table syntax to it, and pastes it back over the text. Feel free to change the hotkey (which in the code is set to AltGr + t). AutoHotkey is great, because it is tool agnostic, so it works wherever your keyboard works. If you wanna run the script you can install AutoHotkey, add the code to a .ahk file (using notepad for example), and run the .ahk file.

A further improvement could be adding toggle functionality to turn a table back into a list.