gatsby-remark-grid-tables
This plugin parses custom Markdown syntax to describe tables. It just includes this package in the gatsby-remark chain
It's useful for extending markdown tables to include things like rowspan, colspan etc.
It adds a new node type to the mdast produced by remark: gridTable
.
A gridTable
mdast node can contain the following mdast node types:
tableHeader
tableRow
tableCell
The stringified HTML result will be a table
.
It is up to you to have CSS rules producing the desired result for these table
.
Syntax
For example:
# Grid table ## Basic example +-------+----------+------+| Table Headings | Here |+-------+----------+------+| Sub | Headings | Too |+=======+==========+======+| cell | column spanning |+ spans +----------+------+| rows | normal | cell |+-------+----------+------+| multi | cells can be || line | *formatted* || | **paragraphs** || cells | || too | |+-------+-----------------+
produces:
Grid tableBasic example Table Headings Here Sub Headings Too cellspansrows column spanning normal cell multilinecellstoo cells can beformattedparagraphs
Note: the top of a cell must be indicated by +-
followed by some -
or +
and finished by -+
.
So, this is not a correct cell:
+--+|a |+--+
But, this is a correct cell:
+---+| a |+---+
Installation
npm:
npm install remark-grid-tables