github markdown colspan

Github Flavored-Markdown

Github Flavored-Markdown Problem Overview


Is there a way to have 'colspan' on github markdown?

I'm trying to create a table where one row takes up four columns.

| One     | Two        | Three   | Four          | 
| ------------- |-------------| ---------| ------------- |
| One                | Two               | Three          | Four                |

| One     | Two        | Three   | Four          | 
| ------------- |-------------| ---------| ------------- |
| Span Across ||||

You can see a live preview by pasting the above here http://markdown-here.com/livedemo.html

Github Flavored-Markdown Solutions


Solution 1 - Github Flavored-Markdown

You can use HTML tables on GitHub (but not on StackOverflow)

<table>
  <tr>
    <td>One</td>
    <td>Two</td>
  </tr>
  <tr>
    <td colspan="2">Three</td>
  </tr>
</table>

Becomes

HTML table output

Solution 2 - Github Flavored-Markdown

Compromise minimum solution:

| One    | Two | Three | Four    | Five  | Six 
| -
| Span <td colspan=3>triple  <td colspan=2>double

So you can omit closing </td> for speed, оr can leave for consistency.

Result from http://markdown-here.com/livedemo.html : markdown table with colspan

Works in Jupyter Markdown.

Update:

As of 2019 year all pipes in the second line are compulsory in Jupyter Markdown.

| One    | Two | Three | Four    | Five  | Six
|-|-|-|-|-|-
| Span <td colspan=3>triple  <td colspan=2>double

minimally:

One    | Two | Three | Four    | Five  | Six
-|||||-
Span <td colspan=3>triple  <td colspan=2>double

Solution 3 - Github Flavored-Markdown

There is no way to do so. Either use an HTML table, or put the same text on several cells.

like this:

| Can Reorder | 2nd operation |2nd operation |2nd operation |
| :---: | --- |
|1st operation|Normal Load <br/>Normal Store| Volatile Load <br/>MonitorEnter|Volatile Store<br/> MonitorExit|
|Normal Load <br/> Normal Store| | | No|
|Volatile Load <br/> MonitorEnter| No|No|No|
|Volatile store <br/> MonitorExit| | No|No|

which looks like

HTML table

Solution 4 - Github Flavored-Markdown

I recently needed to do the same thing, and was pleased that the colspan worked fine with consecutive pipes ||

MultiMarkdown v4.5

Tested on v4.5 (latest on macports) and the v5.4 (latest on homebrew). Not sure why it doesn't work on the live preview site you provide.

A simple test that I started with was:

| Header ||
|--------------|
| 0 | 1 |

using the command:

multimarkdown -t html test.md > test.html

Solution 5 - Github Flavored-Markdown

Adding break resolves your issue. You can store more than a record in a cell as markdown doesn't support much features.

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
Questionuser391986View Question on Stackoverflow
Solution 1 - Github Flavored-MarkdownfreganteView Answer on Stackoverflow
Solution 2 - Github Flavored-MarkdownsherdimView Answer on Stackoverflow
Solution 3 - Github Flavored-MarkdownlanderlyoungView Answer on Stackoverflow
Solution 4 - Github Flavored-MarkdownMarkView Answer on Stackoverflow
Solution 5 - Github Flavored-MarkdownELAVARASI P.SView Answer on Stackoverflow