Evolve
Evolve

Reputation: 9193

Enhance Showdown.js table code so that it supports left/right alignment of table headers

Im using Showdown.js and have implemented the tables extensions and got it working for normal tables.

The extension does not support 'Github Flavoured Markdown' for header alignment.

Example:

|Normal Heading | Right Aligned |
| ------------- | ------------: |     

Please help me with what code I can include in my table.js file to add this support.

I found similar code in marked.js here.

Upvotes: 2

Views: 882

Answers (1)

Tivie
Tivie

Reputation: 18923

Showdown >= 1.2.0 now has built in support for tables (with alignment) in core. You just need to activate it in the options:

var conv = new showdown.Converter({tables: true});

Upvotes: 4

Related Questions