2014-05-09 57 views
45

有沒有辦法'colspan'on github markdowngithub markdown colspan

我想創建一個表,其中一行佔用四列。

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

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

您可以在這裏粘貼上述 http://markdown-here.com/livedemo.html

+2

很抱歉,通知您,Markdown不支持colspan或rowspan。 – mambrow

+0

[MultiMarkdown 4支持colspan](http://fletcher.github.io/MultiMarkdown-4/tables),但它沒有在GitHub上使用 –

回答

40

你可以(在計算器上,但not)在GitHub上使用HTML表格

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

變爲

HTML table output看到一個實時預覽

13

你無法這樣做。 可以使用html表格,也可以在幾個單元格上放置相同的文本。

這樣的:

| 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| 

它看起來像

enter image description here

+1

無法在GitHub上工作 – fabdouglas

9

我最近需要做同樣的事情,並且很高興的是,合併單元格工作得很好用連續管||

MultiMarkdown v4.5

測試在V4.5(最新的MacPorts上)和V5.4(最新的自制軟件)。不知道爲什麼它不適用於您提供的實時預覽網站。

一個簡單的測試,我開始了:

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

使用命令:

multimarkdown -t html test.md > test.html 
+18

這在github上不被支持 – GnP

+1

看起來像一個不錯的標記,我希望看到它接受採用。 – akauppi

12

妥協最低的解決方案:

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

所以,你可以省略結束</td>速度,否則可以保持一致。從http://markdown-here.com/livedemo.html

結果: markdown table with colspan

工程在Jupyter降價。

+1

如果我嘗試在第一列上使用colspan,那麼避免反過來會添加另一個沒有內容的第一列,這個解決方案我遇到了問題... Yuck ... – consideRatio