table
table copied to clipboard
New Table Template - Markdown
Great existing table templates, but one key item that's missing is the Markdown table.
| 0A | 0B | 0C |
|----|----|----|
| 1A | 1B | 1C |
| 2A | 2B | 2C |
| 2A | 2B | 2C |
| 2A | 2B | 2C |
| 2A | 2B | 2C |
| 2A | 2B | 2C |
Results in cool stuff on github, like so:
| 0A | 0B | 0C |
|---|---|---|
| 1A | 1B | 1C |
| 2A | 2B | 2C |
| 2A | 2B | 2C |
| 2A | 2B | 2C |
| 2A | 2B | 2C |
| 2A | 2B | 2C |
Would be nice if we could give users a copy/paste friendly table for github!
https://github.com/adam-p/markdown-here/wiki/Markdown-Cheatsheet#tables
This works as long as the width of each column is >=3 characters.
table(data, {
border: {
topBody: '',
topJoin: '',
topLeft: '',
topRight: '',
bottomBody: '',
bottomJoin: '',
bottomLeft: '',
bottomRight: '',
bodyLeft: '|',
bodyRight: '|',
bodyJoin: '|',
joinBody: '-',
joinLeft: '|',
joinRight: '|',
joinJoin: '|'
},
drawHorizontalLine: (index) => index === 1
})
Shame I can't combine the drawHorizontalLine, I could do the PR to add the template.
Maybe it should return a full config that can be extended? Thoughts? Not sure how to take it from here.