35

As of maruku engine (the default), writing table like

surround text, etc.

| Tables        | Are           | Cool  |
| ------------- |:-------------:| -----:|
| col 3 is      | right-aligned | $1600 |
| col 2 is      | centered      |   $12 |
| zebra stripes | are neat      |    $1 |

surround text...

would render correctly.

But when I switch to redcarpet (add markdown: redcarpet into _config.yml), the table no longer rendered, both localhost and on GitHub Pages.

Did I do something wrong?

neizod
  • 1,582
  • 15
  • 24

5 Answers5

64

Adding only markdown: redcarpet into _config.yml is not enough, It's also need the extensions part, e.g.

markdown: redcarpet
redcarpet:
  extensions: ["no_intra_emphasis", "fenced_code_blocks", "autolink", "tables", "with_toc_data"]
neizod
  • 1,582
  • 15
  • 24
  • 1
    from the Jekyll documentation: http://jekyllrb.com/docs/configuration/#redcarpet And theese are the **Redcarpet extensions**, from the Readme : http://git.io/Xk0CQQ – agustibr Dec 02 '13 at 13:50
6

For this question, it seems the important extension here is "tables".

However if you want more Github flavored markdown, there are a few more listed at http://sholsinger.com/2014/03/jekyll-github-flavored-markdown.

Combining with neizod's answer I ended up using.

markdown: redcarpet
redcarpet:
  extensions: ["no_intra_emphasis", "fenced_code_blocks", "autolink", "tables", "strikethrough", "superscript", "with_toc_data"]
Ben Holland
  • 2,309
  • 4
  • 34
  • 50
2

The redcarpet markdown engine is no longer supported by GitHub Pages and may cease working at any time.

A very straightforward solution is to delete the markdown setting in site's _config.yml file and instead have an extra line between the headline/text and the table.

You can get more information from github help and this solution was taken from this issue.

Mohit Lamba
  • 1,194
  • 13
  • 30
0

How to render table with Redcarpet and Markdown

Also, I can confirm Kramdown will do this.

Community
  • 1
  • 1
Zombo
  • 1
  • 62
  • 391
  • 407
0

For anyone still running into this years later here's an example of how to fix it.

If your markdown is like this:

# My Favorite Books 
| Title | Description |
| ----- | ----------- |
| Attack Surface | A sci-fi book by Cory Doctorow showing how currently available tech can be used to oppress | 

It will render fine on github.org but fail to render on github pages.

The solution is to ass a blank line above you table like so:

# My Favorite Books 

| Title | Description |
| ----- | ----------- |
| Attack Surface | A sci-fi book by Cory Doctorow showing how currently available tech can be used to oppress | 

Thanks to LTChen's answer for putting me on the right track.

RayB
  • 2,096
  • 3
  • 24
  • 42