Problem with markdown tables

107 views
Skip to first unread message

German Jimenez

unread,
Feb 21, 2014, 9:00:42 PM2/21/14
to nikola-...@googlegroups.com
Hi

Nikola is not rendering markdown tables for me. Since I started to writte with markdowm, I find it easier than rst, (just a little), all is working fine except for tables.

I don't even know if this is the way (pipe) to writte tables in markdown

| state          | population | economy | 
|:-----------------|:----------------|:--------------|
| Cordoba     | 341           | 189         | 
| Santa Fe    | 628           | 313         |
| San Luis    | 4669          | 6            |

Does anyone something?

Roberto Alsina

unread,
Feb 21, 2014, 9:05:06 PM2/21/14
to nikola-...@googlegroups.com
Just tried it. Looks like it will work if you enable the tables
extension for markdown in your conf.py, since tables are not part of
markdown proper:

MARKDOWN_EXTENSIONS = ['fenced_code', 'codehilite', 'tables']

German Jimenez

unread,
Feb 21, 2014, 10:08:13 PM2/21/14
to nikola-...@googlegroups.com
Just tried it. Looks like it will work if you enable the tables
extension for markdown in your conf.py, since tables are not part of
markdown proper:

MARKDOWN_EXTENSIONS = ['fenced_code', 'codehilite', 'tables']

It works, thanks 

rand...@gmail.com

unread,
Jan 2, 2019, 5:27:59 PM1/2/19
to nikola-discuss
Hi,

I don't think the above code works anymore and my markdown tables look terrible.  I've used the following settings in conf.py

MARKDOWN_EXTENSIONS = ['markdown.extensions.fenced_code', 'markdown.extensions.codehilite', 'markdown.extensions.extra','markdown.extensions.meta','markdown.extensions.tables']

but it doesn't work.  Please help!

Thanks,

Chris Warrick

unread,
Jan 3, 2019, 9:54:56 AM1/3/19
to Nikola—Discuss
On Wed, 2 Jan 2019 at 23:28, <rand...@gmail.com> wrote:
>
> Hi,
>
> I don't think the above code works anymore and my markdown tables look terrible. I've used the following settings in conf.py
>
> MARKDOWN_EXTENSIONS = ['markdown.extensions.fenced_code', 'markdown.extensions.codehilite', 'markdown.extensions.extra','markdown.extensions.meta','markdown.extensions.tables']
>
> but it doesn't work. Please help!
>
> Thanks,

What do you mean by “terrible”? Using the example in the original
post, I get a properly formatted table with bold headers. If you want
it to look more like a table, you’d need to add a class.
Python-Markdown does not support this:
https://github.com/Python-Markdown/markdown/issues/312

A workaround that makes it look slightly better, although only due to
the way CSS is defined in Bootstrap, would be this:


<div class="table" markdown=1>
| state | population | economy |
|:------------|:--------------|:------------|
| Cordoba | 341 | 189 |
| Santa Fe | 628 | 313 |
| San Luis | 4669 | 6 |
</div>


PS. The `tables` extension is unnecessary if you have `extra` enabled.

--
Chris Warrick <https://chriswarrick.com/>
PGP: 5EAAEA16
Reply all
Reply to author
Forward
0 new messages