MacDownApp / macdown

Open source Markdown editor for macOS.
https://macdown.uranusjr.com/
9.44k stars 1.09k forks source link

Merge columns #614

Open ghost opened 8 years ago

ghost commented 8 years ago

Is it possible to merge multiple columns in Markdown? Like the two last lines in this screenshot that I took in the Byword app. Thanks! 2016-06-05 23 33 24

tjanson commented 8 years ago

This is not possible using the Markdown table syntax. (Or, more correctly, it’s not possible in the table syntax of the dialect of Markdown that the underlying renderer Hoedown uses; nor am I aware of any Markdown dialect / extension that supports this.)

However, you can use HTML to achieve the desired result. E.g., you can get this table

Column 1 Column 2 Column 3
regular cell cell spanning two columns

with this HTML code:

<table>
  <thead>
    <tr>
      <th>Column 1</th>
      <th>Column 2</th>
      <th>Column 3</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td>regular cell</td>
      <td colspan="2">cell spanning two columns</td>
    </tr>
  </tbody>
</table>

This is entirely standard (as far as Markdown standards go); quoting Gruber’s original description:

For any markup that is not covered by Markdown’s syntax, you simply use HTML itself. There’s no need to preface it or delimit it to indicate that you’re switching from Markdown to HTML; you just use the tags.

jcrben commented 6 years ago

nor am I aware of any Markdown dialect / extension that supports this.

fyi, as I discussed at https://stackoverflow.com/questions/46621765/can-i-merge-table-rows-in-markdown/49212652#49212652 it looks like MultiMarkdown does support this type of table, based on the original influence of https://github.com/michelf/php-markdown