The purpose of this proposal is to extend table syntax with support for column and row spans. Major inspiration for this proposal is doxygen markdown table syntax. The aim is to provide a simple and intuitive way to create complex tables with minimal syntax overhead.
Syntax
^ - placed as the only content within a table cell signifies an increase in rowspan for the cell above
> - placed as the only content within a table cell signifies an increase in colspan for the cell to the left
Multiple spans can be added up.
#|
|| Text ||
|| ^ ||
|| ^ ||
|| ^ ||
#|
should produce a cell spanning 4 rows. Similarly, multiple > cells in succession will produce a cell spanning n+1 columns, where n is the number of > cells.
Whitespace is not significant, | ^ |= |^| and | > | = |>|.
It's possible to escape these characters, \> and \^ render a normal table cell with corresponding characters.
This markdown can be interpreted as a broken table with an excess cell:
Heading1
Heading2
Heading3
Text1
Text2
Text3
Text4
Text5
Text6
Text7
Text8
Text9
Text10
To avoid this issue we can let the user know that the spans need to match in such cases, or render the table as plaintext to indicate that the table syntax is broken.
Introduction
The purpose of this proposal is to extend table syntax with support for column and row spans. Major inspiration for this proposal is doxygen markdown table syntax. The aim is to provide a simple and intuitive way to create complex tables with minimal syntax overhead.
Syntax
^
- placed as the only content within a table cell signifies an increase in rowspan for the cell above>
- placed as the only content within a table cell signifies an increase in colspan for the cell to the leftMultiple spans can be added up.
should produce a cell spanning 4 rows. Similarly, multiple
>
cells in succession will produce a cell spanning n+1 columns, where n is the number of>
cells.Whitespace is not significant,
| ^ |
=|^|
and| > |
=|>|
.It's possible to escape these characters,
\>
and\^
render a normal table cell with corresponding characters.Examples
Basic rowspan
Markdown input
Rendered HTML
Basic colspan
Markdown input
Rendered HTML
Mixed colspan and rowspan
Markdown input
Rendered HTML
Edge cases
Mismatched spans
If a rowspan does not have a corresponding colspan, it can result in broken table layout. For instance:
This markdown can be interpreted as a broken table with an excess cell:
To avoid this issue we can let the user know that the spans need to match in such cases, or render the table as plaintext to indicate that the table syntax is broken.