Tables in pure Markdown

this was a starter idea, my last idea would be something like this:

{| 
  header1, header2, header3, header4 ... 
 |} {| 
  value1 header1,  value 2 header1 ... 
  value1 header2,  value 2 header2 ... 
  value1 header3,  value 2 header3 ... 
  value1 header4,  value 2 header4 ...  
|}

based on this:

{|
! Header !! Another header
|-
| field 1 || something
|-
| field 2
| something else
|}

I don’t know if the syntax is good or valid, but I wanted to know your opinion

Hi - what’s the status of this feature? Is there something people are using to get this to work? Thanks.

@blakew the status is that noone is going to implement this anytime soon. They just dont know how…

1 Like

It’s not in the spec, but there are plenty of commonmark implementations out there that offer table extensions compatible with what GitHub uses.

Hello everyone! :wave:

Here’s an idea I had over the weekend.

,,,
header1 , header2 , header3
item1   , item2   , item3
item4   , item5   , item6
,,,

Pipes work too.

,,,
header1 | header2 | header3
item1   | item2   | item3
item4   | item5   | item6
,,,

I created a repo with all the deets.

2 Likes

What would your idea’s advantages be over the following?

``` csv
header1 , header2 , header3
item1   , item2   , item3
item4   , item5   , item6
```

By sticking with existing fenced code syntax, it degrades gracefully under generic Markdown processing.

(There’s a related discussion about whether fenced code blocks can be interpreted, processed or executed.)

4 Likes

:thinking: Hmm… that’s a good question.

  1. Primarily, it won’t conflate the 2 features. Tables vs fenced code blocks, when is something “common”? - #11 by chrisalley
  2. The csv fenced code block removes the option to display the fenced contents as plaintext with highlighting.
2 Likes

Chiming into this thread here to note that i’ve recently extended my team’s fork of cmark-gfm to add basic support for row- and column-span: add support for colspan/rowspan in tables by QuietMisdreavus · Pull Request #46 · apple/swift-cmark · GitHub

I pulled the syntax ideas from this thread, so thanks for having this discussion here. I didn’t add things like row headers or multi-line headers, since i wanted to keep the implementation fairly unobtrusive and i figure that those can be added on independently.

1 Like

It surprises me how often people want to reinvent AsciiDoc.

1 Like

Just FYI, GitHub do support tables which interrupt a paragraph, although they don’t seem to state this explicitly in their GFM spec (see Tables (extension)) for some reason.

2 Likes

I think more people will agree on that, the longer MD exist.