Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New Table Template - Markdown #53

Open
GantMan opened this issue Nov 12, 2017 · 2 comments
Open

New Table Template - Markdown #53

GantMan opened this issue Nov 12, 2017 · 2 comments

Comments

@GantMan
Copy link

GantMan commented Nov 12, 2017

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

@GantMan
Copy link
Author

GantMan commented Nov 12, 2017

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
})

@GantMan
Copy link
Author

GantMan commented Nov 12, 2017

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants