erusev / parsedown

Better Markdown Parser in PHP
https://parsedown.org
MIT License
14.74k stars 1.12k forks source link

Feature request: rowspan, colspan #682

Open darkopetreski opened 5 years ago

darkopetreski commented 5 years ago

It is very usefull if a cell merge is added. The cell merge should be in a form of collspan and rowspan. Example if a cell is empty, should be collspan. Or also ">" can be used to merge cell with the right cell. For rowspan "^" can be used to merge with the upper cell. Multiple merges needs to be allowed.

Can colspan and rowspan be added ?

Example markup can be seen here https://tiddlywiki.com/static/Tables%2520in%2520WikiText.html

2018-11-25_14-30

aidantwoods commented 5 years ago

Probably not as default behaviour, but would be interesting as optional behaviour. I'm not convinced the linked spec is well defined though: how should the row

| foo |>|<| bar |

be rendered?

darkopetreski commented 5 years ago

Probably not as default behaviour, but would be interesting as optional behaviour. I'm not convinced the linked spec is well defined though: how should the row

| foo |>|<| bar |

be rendered?

Indeed this is undefined case. Even so, if you find such case, there will be still benefit of this, because in real work cases tables are often complex.

But I found better markup than this. Currently I am using this tool to generate tables https://texy.info/en/syntax https://texy.info/en/try

It has a different markup and will not have the problem you specified. Example

|col1|col2|col3| |col1|col2|| |^|col2|col3|

Col2 will merge with the next column, since the next column is collapsed. If we need empty cell just will type space | | The "^" will merge the cell with the above cell.

Here is a more complex example 2019-02-23_10-17

BenjaminHoegh commented 5 years ago

I can add this to my extension