Cimbali/markdown-viewer

Add support for TABLE markdown syntax

Closed this issue · 4 comments

|Header1 |Header2  | Header3|
--- | --- | ---
|data1|data2|data3|
|data11|data12|data13|

See https://www.w3schools.io/file/markdown-table/

GitHub, Phabricator, GitLab (I think) and others support this syntax. Wouldbe nice to have.

Thanks.

These already work. You’re missing a leading and closing | on the second tow of your syntax:

|Header1|Header2|Header3|
|--- | --- | ---|
|data1|data2|data3|
|data11|data12|data13|

It’s part of the test file, here’s how that renders:

image

The test file also shows the different alignment options:

| Left-Aligned  | Center Aligned  | Right Aligned |
| :------------ |:---------------:| -----:|
| col 1 is      | some wordy text | $1600 |
| col 2 is      | centered        |   $12 |
| zebra stripes | are neat        |    $1 |

Screenshot 2021-08-21 at 16-49-23 CMDR Snert
In my actual use case I was doing

Rankings
--------

|Combat     | Almost Elite       |
|Trader     | Elite              |
|Exploration| Elite              |
|CQC        | What's That?       |
|BPit       | Born To The Onesie |

There are trailing (space-space after the closing |) I had no heading. It wasn't formatted by the plugin. Often I want a table structure without headings.

The table only works if I add an empty header row and divider line...

Rankings
--------

 |             |                    |  
 |:------------|:-------------------|  
 | Combat      | Almost Elite       |  
 | Trader      | Elite              |  
 | Exploration | Elite              |  
 | CQC         | What's That?       |  
 | BPit        | Born To The Onesie |  

Yes markdown tables always require headers, that’s just how the specs are. It’s also the case on github and everywhere else. The following code:

| a | b |
| c | d |

Renders as:

| a | b |
| c | d |