
Show HN: Excel-like table editing for Markdown - jakew
https://blog.documentnode.io/when-markdown-meets-tables
======
acidburnNSA
Looks really slick. Thanks for the contribution!

I don't know if this is sacrilege or not here but I really like
reStructuredText's list-table directive [1] for this kind of thing. It
provides a text-friendly editable representation that renders to a nice table.
There's a CSV-based table directive also (scroll up one in the link).

    
    
       .. list-table:: Frozen Delights!
          :widths: 15 10 30
          :header-rows: 1
    
          * - Treat
            - Quantity
            - Description
          * - Albatross
            - 2.99
            - On a stick!
          * - Crunchy Frog
            - 1.49
            - If we took the bones out, it wouldn't be
              crunchy, now would it?
          * - Gannet Ripple
            - 1.99
            - On a stick!
    

I like Markdown a lot for simple things like notes and readmes. When I write
technical documentation and when I wrote my e-book, RST had the extended
feature set I needed.

[1]
[https://docutils.sourceforge.io/docs/ref/rst/directives.html...](https://docutils.sourceforge.io/docs/ref/rst/directives.html#list-
table)

~~~
crooked-v
When it comes to 'text-friendly' I far prefer nicely formatted MMD tables...

    
    
      | Treat         | Quantity   | Description                                                     |
      | :------------ | :--------  | :-------------------------------------------------------------- |
      | Albatross     | 2.99       | On a stick!                                                     |
      | Crunchy Frog  | 1.49       | If we took the bones out, it wouldn't be crunchy, now would it? |
      | Gannet Ripple | 1.99       | On a stick!                                                     |
      [Frozen Delights!]
    

...despite the comparative hassle in editing them. It's just so much more
readable at a glance later.

------
cryptos
Although it looks nice, tables and Markdown are not a good fit. The syntax for
tables in Markdown is broken by design!

AsciiDoc got it right: [https://asciidoctor.org/docs/asciidoc-syntax-quick-
reference...](https://asciidoctor.org/docs/asciidoc-syntax-quick-
reference/#tables) You can even have formatted source code in AsciiDoc table
cells. Try this with Markdown ...

~~~
goblin89
I find _complex_ tables frustrating to read and write in AsciiDoc. The markup
can be written in a way that visually does not resemble the resulting table at
all; newlines within cells (apparently) require actual newlines breaking “one
row per line of markup” intuitive mapping; syntax errors or mismatched
col/rowspans are difficult to spot; and so on.

    
    
        h|row 1 |foo .2+|bar |baz 5+|newline +
        inside cell |last cell
        h|another row |bar .2+||||
        ...
    

I actually prefer reStructuredText’s approach[0], which while being a hassle
to edit, at least ensures table markup visually resembles the result.

Overall I feel like having to manually edit a complex table is often a sign of
a flawed process somewhere, and should ideally be eliminated—author data in a
structured way, and render it as a table automatically. (In the end it
depends, of course.)

[0]
[https://docutils.sourceforge.io/docs/user/rst/quickref.html#...](https://docutils.sourceforge.io/docs/user/rst/quickref.html#tables)

~~~
ssb1
ReStructuredText also has list tables. And CSV tables. [https://sublime-and-
sphinx-guide.readthedocs.io/en/latest/ta...](https://sublime-and-sphinx-
guide.readthedocs.io/en/latest/tables.html)

------
m3at
There is also a vim plug-in that do much of the same, even handling formulas
(!):

[https://github.com/dhruvasagar/vim-table-
mode/blob/master/RE...](https://github.com/dhruvasagar/vim-table-
mode/blob/master/README.md)

Personally I prefer to keep my markdowns simple, as it was explicitly designed
to be a simple markup readable in raw form. Often the constraints of
simplicity force me to think deeper about what I'm trying to explain so as to
fit the format; limitations can be a strength.

------
szhu
Possibly relevant for those looking for easier ways to create Markdown tables:
A few years ago, I wrote a spec for Markdown tables using a subset of YAML --
no GUI required for authoring.

Curious what HN thinks of it:
[https://github.com/IFTTT/tablerize](https://github.com/IFTTT/tablerize)

~~~
vanderZwan
I like it! Reminds me a bit of comma separated trees:

[https://observablehq.com/@mbostock/comma-separated-
tree](https://observablehq.com/@mbostock/comma-separated-tree)

------
sulami
I’ll be that one person:

org-mode already does tables with formulas and all[1], if you’re interested in
text-based spreadsheets

[1]:
[https://orgmode.org/manual/Tables.html](https://orgmode.org/manual/Tables.html)

~~~
dig1
Yes! Nicely integrates with almost everything through org-mode's babel [1]
(those not familiar with Emacs, org-mode babel is like Jupyter notebook on
steroids). If you find org-mode table column formulas complicated, you can use
other languages instead. Here is example with R [2].

For me org-mode became interface to glue other tools and languages, plus I get
documenting facility for free. Just like bash/shell for unix tools.

[1] [https://orgmode.org/worg/org-
contrib/babel/](https://orgmode.org/worg/org-contrib/babel/)

[2] [https://orgmode.org/worg/org-
contrib/babel/intro.html#spread...](https://orgmode.org/worg/org-
contrib/babel/intro.html#spreadsheet)

~~~
parhamn
That got a good laugh out of me. Very org-mode-user of you to call Babel
"Jupyter notebook on steroids". Anyone else would take one look and say "wtf
are you talking about?"

~~~
adminu
Uhm, could you elaborate? Org mode/Babel supports many languages and is
feature rich. Why would you say, the statement "Babel is Jupyter notebook on
steroids" is laughable?

~~~
parhamn
Honestly, I meant that lightly. My apologies. I found it humorous because it
followed the (gui-version)^2 format of emacs-like tool endorsements.

If you want an actual reason, the two are not even close. Jupyter is a multi-
langauge kernel _server_. Also most of its users are data scientists and the
things they care about are pandasDfs, charts, tables which makes html
rendering much more capable. You might say there are plugins and ways to do
all the things I mentioned org mode/babel, but that misses the point. They're
very different products.

------
tomerbd
[https://typora.io/](https://typora.io/) is also excellent for that

~~~
dejj
Looks so nice. Too bad their Debian repo
[https://typora.io/linux/](https://typora.io/linux/) has gone away. Are the
sources published somewhere? Seems like Github only has the website and some
themes.

------
majkinetor
Editor extensions go along the way instead propriatery BS for stuff that
should be foss in 2020.

Example - with VSCode you have Markdown all in one [1]

Just do "Format Current Table" and thats it, see a picture [2]. Along with
column editing and other advanced editor features there is simply no need for
anything else, such as excel like GUI.

When I see "pricing" on markdown editor, I really get nausea

[1]
[https://marketplace.visualstudio.com/items?itemName=yzhang.m...](https://marketplace.visualstudio.com/items?itemName=yzhang.markdown-
all-in-one)

[2] [https://github.com/yzhang-gh/vscode-
markdown/raw/master/imag...](https://github.com/yzhang-gh/vscode-
markdown/raw/master/images/gifs/table-formatter.gif)

~~~
leppr
The Free in FOSS is not for free as in free beer [1]. If you get nausea at
people wanting to be compensated for their work, you have a problem.

[1]: [https://www.gnu.org/philosophy/floss-and-
foss.en.html](https://www.gnu.org/philosophy/floss-and-foss.en.html)

~~~
majkinetor
Nah, I get nausea at people wanting to be compensated for reinventing the
weel.

------
donatj
I built a little tool a while ago that converts CSV/TSV to Markdown. I use it
mostly o convert MySQL EXPLAIN's to Markdown for pull requests.

[https://donatstudios.com/CsvToMarkdownTable](https://donatstudios.com/CsvToMarkdownTable)

------
neves
Latex failed for me in table generation. It is great to write without concerns
about formatting, but it is really hard to create a table in Latex. Hope
Markdown solves this problem, but it isn't easy to solve the usability issues.

~~~
auxym
Writing raw latex sort of sucks for more than tables. You need a specialized
editor/plugin for your favorite editor. I like LyX a lot!

------
stadeschuldt
I have recently bought an app for macOS that helped me handling tables in
markdown: [https://tableflipapp.com/](https://tableflipapp.com/)

It does one thing and it does it well.

------
hnal943
Needing tools to edit markdown seems to defeat the point, doesn't it?

------
fortylove
Very nice! It would be really cool if you can do some simple math too, like
=sum(...), and have it update the markdown for you. I like it!

~~~
zelphirkalt
You mean, like in org mode tables?

~~~
fortylove
I've seen reference to org mode quite a few times now. I will have to check it
out.

~~~
bloopernova
It's a massive, huge, enormous thing.

It will seem daunting at first. Especially if you have to learn Emacs as you
go.

[https://orgmode.org/worg/org-
tutorials/org4beginners.html](https://orgmode.org/worg/org-
tutorials/org4beginners.html)

That tutorial seems pretty good, it starts from the absolute beginning.

------
kristiandupont
Oh, this is interesting! I created a webpack loader for markdown files because
I use tables to store config and test data
([https://www.npmjs.com/package/mdconf-
loader](https://www.npmjs.com/package/mdconf-loader)) -- formatting in vscode
already helps, but this will take it to another level.

------
josh3736
After simply _opening_ a md file, I found that Document Node corrupted it
(linebreaks disappeared and content replaced with garbage characters).

Fortunately, the file was in a git repo, so I was able to revert and no harm
done, but that does not exactly inspire confidence...

~~~
jakew
Thanks for letting us know about the issue. Was your document in a different
encoding rather than UTF-8? We will find it out and fix it shortly.

~~~
josh3736
Document in question is [https://github.com/useful-
bytes/netsleuth/blob/v1.0.9/README...](https://github.com/useful-
bytes/netsleuth/blob/v1.0.9/README.md)

It's UTF-8 with unix line endings.

------
fiatjaf
See also [https://stevecat.net/table-magic/](https://stevecat.net/table-
magic/) for quickly editing and translating tables between
CSV/TSV/HTML/Markdown/SQL.

------
xixixao
This is good but it'd be even better inline, the same way Bear both displays
markdown and shows the markers, you could imagine that the "Excell" UI could
be embedded inside the plain text editor.

~~~
jakew
That's a very interesting idea. Something worth having a research. I've taken
notes for it. Thanks.

------
sadness2
I'd adopt this immediately if it could integrate with editors like vscode

~~~
cstuder
While we wait for somebody else to implement this, here is a first step:
Install the `prettier` extension and turn on autoformat for markdown.

It makes entering tables much easier and the tables more readable.

------
begemotz
My table needs are rather simple but I use:
[http://www.tablesgenerator.com/markdown_tables](http://www.tablesgenerator.com/markdown_tables)

------
lifeisstillgood
Hmmm, it's at this point I really want to improve the docutils/sphinx table
handling...

------
Haow
Hope the markdown table can support some high-level options like function,
I'll love it。

~~~
jakew
I will add simple functions in the next version. Specifically in two or three
weeks. I promise.

~~~
laumars
Your demo doesn't show any cell padding. Is this the case for the final
product? If so, is that something you're working on?

I'm not a huge fan of tables in markdown but if they're necessary then it
should at least be readable in clear text and without padding it's not.

eg with padding:

    
    
        | which | column | is  | the | value | foo | in | ? |
        |-------|--------|-----|-----|-------|-----|----|---|
        |       |        | foo |     |       |     |    |   |
    

vs without padding

    
    
        | which | column | is | the | value | foo | in | ? |
        |-------|--------|-----|-----|-------|-----|----|---|
        |  |  | foo |  |  |  |  |  |

~~~
jakew
I have thought about this. Padding works when the text in a cell is not too
long. When cell texts are arbitrary long, "padding" doesn't make sense any
more.

Document Node is not just a pure Markdown editor, it has a beautiful HTML5
preview area, where you can see your tables in a perfect format. You can
define your own styles using CSS, although we have 11 preview styles built-in.

Having said that, I think it's a good idea to give the users the option to
enable padding. I will add that option in a later version.

There never be a final product for us and stop there, we will keep improving
it and roll new versions frequently.

~~~
laumars
> _I have thought about this. Padding works when the text in a cell is not too
> long. When cell texts are arbitrary long, "padding" doesn't make sense any
> more._

I do understand your point but you could also argue that's when you need
padding the most because it becomes infinitely harder to visually parse the
raw text.

I like your idea for giving people the option though.

> _Document Node is not just a pure Markdown editor, it has a beautiful HTML5
> preview area, where you can see your tables in a perfect format._

Document Node is a nicely polished product but it's worth remembering that the
point of markdown is that it's still readable without needing a viewer that
supports rich formatting. For example it should be just as readable in the
terminal as it is in a HTML5 container (this is one of the reasons I don't
really like tables in markdown but that ship has already sailed).
Unfortunately not everyone will be using Document Node to view their markdown.

~~~
jakew
Thanks for your comment. It totally makes sense.

Sometimes, it is the art of balance. As a product, the goal is to save users
time as much as possible. Eventually, the users have to decide whether it's
appropriate to put a super complex table in Markdown, although it will be fine
for tables with short rows.

While I'm writing this reply, I thought of how to improve this in Document
Node. It can automatically check and add padding depending on whether any
Markdown rows exceed 80 characters (or similar). One less thing to worry
about.

------
anderspitman
OT - has anyone ever managed to make a decent text-based spreadsheet file
format?

------
wiradikusuma
@jakew can your product work as front-end for Joplin?

~~~
jakew
Not sure about the notes format of Joplin. If it's Markdown files, then yes,
you can open any Markdown folders in Document Node.

However, many users are using Document Node for notes taking, as it provides
the most flexible way to arrange your content simply in folders.

------
saadalem
What do you think of Markdown forms ?

~~~
jakew
I haven't evaluated how important is that for daily uses. :) I saw there was a
discussion in CommonMark's forum.

------
faywong
what gui library does this app use？It seems cool.

~~~
jakew
Thanks for letting us know you think it's cool. :)

The GUI library is QT. But not ordinary Qt, we did lots of customization. A
large amount of time invested in polishing it.

~~~
faywong
Thanks for clarify. The tiny version of Qt you polished is the key weapon
behind the product.

I always pay attention to GUI/render related projects.

------
james_smith_007
I don't need a software that require me to sign in before use.

