'Tables in Markdown (in Jupyter)

A super basic question: why is the following not rendering in Markdown - which happens to be in a jupyter notebook

Raw code

### Results

| --- | --- | --- |
| Stretch/Untouched | ProbDistribution | Accuracy |
| --- | --- | --- |
| Stretched | Gaussian | .843 |

Code as it looks in jupyter in edit mode

enter image description here

Rendering in jupyter

enter image description here

So the table did not render properly

Update I did some twiddling and now it renders.. but still uncertain why the original code did not work

enter image description here



Solution 1:[1]

Even though this question has been answered, still dropping this here - it may help someone else. I too was not able to render tables in jupyter notebook.

Example:


    | | Sentence #  | Word    | POS   | Tag   |
|---:|:-------------|:-----------|:------|:------|
| 1 | Sentence: 1  | They       | PRP   | O     |
| 2 | Sentence: 1  | marched    | VBD   | O     |

Output:

| | Sentence # | Word | POS | Tag | |---:|:-------------|:-----------|:------|:------| | 1 | Sentence: 1 | They | PRP | O | | 2 | Sentence: 1 | marched | VBD | O |

I was not able to figure out why this was happening but for some strange reason when I enter text in the first cell of first row, it was rendering fine. So here I entered Sno. in the very first cell and it's working fine.

Output:

enter image description here

Solution 2:[2]

One could also use HTML tags in a notebook Markdown to create the table:

<table ><tr><th >Stretch/Untouched <th><th> ProbDistribution <th><th> Accuracy <tr><tr>
<tr><td> Stretched <td><td> Gaussian <td><td> .843 <td><tr><table>

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Nutan
Solution 2 CoralReef