Rowspan syntax in Markdown

28,248

Solution 1

As of today, there is no syntax for tables in standard Markdown language. You can find that within some Markdown extensions like MultiMarkdown or Markdown Extra, but no rowspan support.

You can still include html code in your markdown like in this example:

**Hello**
<table>
<tr><td>rowspan1</td><td rowspan="2">rowspan2</td></tr>
<tr><td>rowspan1</td></tr>
</table>
*World*

Solution 2

I think I'm a little late, but you can't take it so narrowly. Actually was able to do tricks like this with Joplin using the plugin "MultiMarkdown", because you can use normal HTML markup within the table cells :

|
|1<td rowspan="2">3</td>
|2 
|4|5| 

This is a pretty nasty mix of Markdown and HTML which I'm pretty sure will make some people frown. What results in something like this :

fig.1 using MultiMarkdown

What is very important is that Multimarkdown is not the one that allows this mixture of Markdown and HTML, no it also works with normal Markdown 2.0.

Multimarkdown is actually a table plugin that allows me to omit the header and the extra two cells on the right side.

The closest to what the OP requested, and what I think can be created with vanilla Markdown 2.0 (without MultiMarkdown) would look like this:

|A |B
|--|--
|1<td rowspan="2">3</td>|2
|4|5
|6|7 

fig.2 using vanilla Markdown2.0

Share:
28,248

Related videos on Youtube

Paulino III
Author by

Paulino III

Updated on August 21, 2021

Comments

  • Paulino III
    Paulino III over 2 years

    I'm trying to create a table in markdown syntax where a cell's content spans across various rows. How can I achieve this?

    The table should look something like:

    http://www.w3resource.com/html/attributes/html-rowspan-attribute-with-td-element.png

    Thanks in advance!

  • Christian
    Christian almost 5 years
    And that's the other reason why link content should best be summarized in a response... that "example" link is (probably long) gone now :(
  • Robin James Kerrison
    Robin James Kerrison over 2 years
    @Christian it's been a few years but I've found and added that missing example content
  • Christian
    Christian over 2 years
    @RobinJamesKerrison A bit too late for my use case but in the name of everyone reading this in the future: thank you :)
  • Miquel Al. Vicens
    Miquel Al. Vicens over 2 years
    What about rowspan in the first cell of row?
  • Rinor
    Rinor almost 2 years
    What I did is, instead of using rowspan at all, I just kept one cell but used <br /> to set the next item underneath the first