markdown-here icon indicating copy to clipboard operation
markdown-here copied to clipboard

Add spanned columns in tables

Open nkalvi opened this issue 10 years ago • 9 comments

Please add support for spanned column in tables - as implemented in some other MD variants.

nkalvi avatar Apr 22 '14 13:04 nkalvi

Can you provide pointers toward the spanning syntax used in other MD variants?

Unsatisfying workaround: You can use raw HTML, like so:

<table>
    <tr>
        <th>Col 1</th>
        <th>Col 2</th>
        <th>Col 3</th>
    </tr>
    <tr>
        <td colspan="2">span 2 cols</td>
        <td rowspan="2">span 2 rows</td>
    </tr>
    <tr>
        <td>stuff</td>
        <td>stuff</td>
    </tr>
</table>​

Except that because of #157 it won't actually render very nicely -- it'll work a lot better if you put all the HTML on a single line.

search keywords: colspan rowspan

adam-p avatar Aug 13 '14 12:08 adam-p

A follow-up to this...

It seems that MultiMarkdown does have colspan syntax, but not rowspan.

Probably the best way to do rowspan and colspan right now is to use this online HTML table generator to create your table, and then paste it into your email (or whatever) and use MDH to render it. Make sure to check the boxes for "Do not generate CSS" (because MDH provides the CSS) and "Compact mode" (to avoid the multi-line HTML problem I mentioned above).

(I'm also going to add that to the Tips & Tricks wiki page.)

adam-p avatar Mar 03 '15 14:03 adam-p

Hi @adam-p! Do you think it would be feasible to implement rowspan in a Markdown parser at all?

sixtyfive avatar Nov 05 '16 03:11 sixtyfive

I like Textile's syntax for spans:

A backslash \ is used for a column span.

|\2. spans two cols | | col 1 | col 2 |

A forward slash / is used for a row span.

|/3. spans 3 rows | row a | | row b | | row c |

CTimmerman avatar Jul 23 '18 14:07 CTimmerman

Uhm.. so no rowspan or colspan unless we write HTML? :/

voronin-de avatar Dec 08 '21 12:12 voronin-de

that link is dead btw, @CTimmerman

sixtyfive avatar Dec 08 '21 14:12 sixtyfive

that link is dead btw, @CTimmerman

Then use inline HTML instead. https://stackoverflow.com/a/35485694/819417

CTimmerman avatar Dec 08 '21 16:12 CTimmerman

that was easy to misunderstand, apologies. i meant that the link to Textile's docs that you posted above ("https://txstyle.org/doc/15/tables") is dead. it should be https://textile-lang.com/doc/tables instead.

sixtyfive avatar Dec 08 '21 20:12 sixtyfive

that was easy to misunderstand, apologies. i meant that the link to Textile's docs that you posted above ("https://txstyle.org/doc/15/tables") is dead. it should be https://textile-lang.com/doc/tables instead.

Thanks. I couldn't find the new link due to https://pypi.org/project/TxtStyle/ which is probably why they renamed it.

CTimmerman avatar Dec 09 '21 09:12 CTimmerman