Reputation: 30906
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.
Upvotes: 161
Views: 207915
Reputation: 31718
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
Upvotes: 121
Reputation: 1236
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 :
Works in Jupyter Markdown.
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 (does not work at Jupyter Lab):
One | Two | Three | Four | Five | Six
-|||||-
Span <td colspan=3>triple <td colspan=2>double
Upvotes: 88
Reputation: 1810
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
Upvotes: 25
Reputation: 678
I recently needed to do the same thing, and was pleased that the colspan worked fine with consecutive pipes ||
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
Upvotes: 18