https://github.com/showdownjs/table-extension
Add markdown table flavor to showdown
https://github.com/showdownjs/table-extension
Last synced: over 1 year ago
JSON representation
Add markdown table flavor to showdown
- Host: GitHub
- URL: https://github.com/showdownjs/table-extension
- Owner: showdownjs
- License: bsd-2-clause
- Created: 2015-01-05T01:12:38.000Z (over 11 years ago)
- Default Branch: master
- Last Pushed: 2015-11-20T16:20:10.000Z (over 10 years ago)
- Last Synced: 2024-05-09T13:14:41.689Z (about 2 years ago)
- Language: JavaScript
- Homepage:
- Size: 26.4 KB
- Stars: 18
- Watchers: 6
- Forks: 13
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
Showdown's Table Extension
==========================
[](https://travis-ci.org/showdownjs/table-extension) [](http://badge.fury.io/js/showdown-table) [](http://badge.fury.io/bo/showdown-table)
------
# IMPORTANT NOTICE
**THIS EXTENSION IS DEPRECATED**
As of showdown v 1.2.0, table support was moved into core as an opt-in feature making this extension obsolete.
As such, this extension will not receive further updates.
-----
**Add markdown table flavor to [showdown](https://github.com/showdownjs/showdown)**
Adds support for:
| Col 1 | Col 2 |
|======== |====================================================|
|**bold** | ![Valid XHTML] (http://w3.org/Icons/valid-xhtml10) |
| Plain | Value |
## Installation
### With [npm](http://npmjs.org)
npm install showdown-table
### With [bower](http://bower.io/)
bower install showdown-table
### Manual
You can also [download the latest release zip or tarball](https://github.com/showdownjs/table-extension/releases) and include it in your webpage, after showdown:
<script src="showdown-table.min.js">
### Enabling the extension
After including the extension in your application, you just need to enable it in showdown.
var converter = new showdown.Converter({extensions: ['table']});
## Example
```javascript
var converter = new showdown.Converter({extensions: ['table']}),
input = '| Col 1 | Col 2 |' +
'|======== |====================================================|' +
'|**bold** | ![Valid XHTML] (http://w3.org/Icons/valid-xhtml10) |' +
'| Plain | Value |';
html = converter.makeHtml(input);
console.log(html);
```
This should output the equivalent to:
```html
<table>
<tr>
<td>Col 1</td>
<td>Col 2</td>
</tr>
<tr>
<td><strong>bold</strong></td>
<td><img alt="Valid XHTML" src="http://w3.org/Icons/valid-xhtml10"></td>
</tr>
<tr>
<td>Plain</td>
<td>Value</td>
</tr>
</table>
```
## License
These files are distributed under BSD license. For more information, please check the [LICENSE file](https://github.com/showdownjs/table-extension/blob/master/LICENSE) in the source code.