codimd icon indicating copy to clipboard operation
codimd copied to clipboard

Support multi-row and row span table syntax

Open a60814billy opened this issue 5 years ago • 2 comments
trafficstars

This PR support two new table syntax, one is multi-row syntax that use \ to merge multiple row into one row. another is row-span syntax that can merge multiple column into one colume (like html rowspan attribute)

  1. multi-row syntax example
|   Markdown   | Rendered HTML |
|--------------|---------------|
|    *Italic*  | *Italic*      | \
|              |               |
|    - Item 1  | - Item 1      | \
|    - Item 2  | - Item 2      |
|    ```python | ```python       \
|    .1 + .2   | .1 + .2         \
|    ```       | ```           |
  1. row span syntax
Stage | Direct Products | ATP Yields
----: | --------------: | ---------:
Glycolysis | 2 ATP ||
^^ | 2 NADH | 3--5 ATP |
Pyruvaye oxidation | 2 NADH | 5 ATP |
Citric acid cycle | 2 ATP ||
^^ | 6 NADH | 15 ATP |
^^ | 2 FADH2 | 3 ATP |
**30--32** ATP |||
[Net ATP yields per hexose]

a60814billy avatar Feb 26 '20 02:02 a60814billy

Nice! But found that our existing table auto format would break this syntax

Yukaii avatar Feb 26 '20 11:02 Yukaii

it's a known issue, maybe we can add preference options to turn off table auto formatting.

a60814billy avatar Feb 26 '20 14:02 a60814billy