Markdown table rowspan without loss of formatting

Viewed 775

As described in this and this answers, we can use HTML tags in Markdown to create tables with cells spanning multiple rows or columns. Suppose I want to make the following table (rendered by Visual Studio Code with extension "Markdown All in One"):

Desired Effect

But the problem for the second answer is that the rowspan/colspan of the first column/row will be rendered with a additional column/row in the front, as in the following example (does not work on StackOverflow, but works in VSCode; a work-around is to add an empty column/row, as suggested by the first comment in that answer, but this is still not perfect):

||Letter|Typesetting|Result|
|-|-|-|-|
|<td rowspan=4>a |Normal|a
||Italic|*a*|
||Bold|**a**|
||Math|$a$

Result:

Table constructed using method in Answer 2

Then we can use the HTML tags, as described by the first answer:

<table>
    <thead>
        <tr> <th>Letter <th>Typesetting <th>Result
    </thead>
    <tbody>
        <tr> <td rowspan=4>a <td>Normal <td>a
        <tr> <td>Italic <td>*a*
        <tr> <td>Bold <td>**a**
        <tr> <td>Math <td>$a$ 
    </tbody>
</table>

But then Markdown formatting will be lost:

Table constructed using method in Answer 1

Is there any way to overcome this problem, i.e. using HTML tags to achieve rowspan/colspan without loss of Markdown text formatting?

0 Answers
Related