Skip to content

Jamesford/mdtable

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

mdtable

(╯°□°)╯︵ ┻━┻ Generate markdown tables

See it in action, https://mdtables.stobbs.xyz

Install

$ npm install mdtable
$ yarn add mdtable

Usage

const mdtable = require('mdtable')

const table = {
  header: ['A', 'B', 'C'],
  alignment: ['L', 'C', 'R'],
  rows: [
    ['1', '2', '3'],
    ['4', '5', '6'],
    ['7', '8', '9']
  ]
}

const settings = {
  borders: true, // Toggle outer borders of the table
  padding: 1     // Padding on each side of the longest string
}

mdtable(table, settings)
// -> `
| A | B | C |
|:--|:-:|--:|
| 1 | 2 | 3 |
| 4 | 5 | 6 |
| 7 | 8 | 8 |
`

About

(╯°□°)╯︵ ┻━┻ Generate markdown tables

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published