Raw Table
ℹ️
usePreParser
hook should be used to fetch all rows of the table.
ℹ️
If provided, all the tables will be rendered using raw table only.
By default, raw table doesn't works out of the box and is mapped to null. If declared, all tabled will be rendered using the raw_table_row
and will be wrapped inside raw_table_wrapper
.
If raw_table_wrapper is not provided, then all the table rows will be rendered as a list without any parent node.
Pre-Defined Syntax
blocks: {
raw_table_row: null,
raw_table_wrapper: null,
}
Usage
blocks: {
raw_table_row: (cols, key) => (
<li key={key}>
<h1>{cols[0]}</h1>
<p>{cols[1]}</p>
<em>{cols[2]}</em>
</li>
),
raw_table_wrapper: (items, key) => <ul key={key}>{items}</ul>
},
-
raw_table_row
It get two parameterscols
andkey
. Cols is the array of table row data without column names. First parameter length is equal to the table width. -
raw_table_wrapper
The wrapper element for all rows rendered usingraw_table_row
.