Savage-mdtable
A library for generate markdown tables.
Installtion
npm i savage-mdtablepnpm add savage-mdtableyarn add savage-mdtableFeature
- support CJS & ESM
- support typescript type definition
- generate a markdown (GFM) table.
How to use
ts
import { mdtable } from 'savage-mdtable'
import type { TableOptions } from 'savage-mdtable'
const options: TableOptions = {
header: ['A', 'B', 'C'],
alignment: ['L', 'C', 'R'],
rows: [
['1', '2', '3'],
['4', '5', '6'],
['7', '8', '9']
]
}
console.log(mdtable(options))
// it will be
| A | B | C |
|:--|:-:|--:|
| 1 | 2 | 3 |
| 4 | 5 | 6 |
| 7 | 8 | 8 |
`Issues
Please let me know if there are any issues, click this link.