github - 我可以在 Markdown 中合并表格行吗

标签 github markdown github-flavored-markdown

有没有办法在 ReadMe.md 文件等 Markdown 文件中的表列中创建合并行?

类似这样的:

table

最佳答案

不,这对于 GitHub 风格的 Markdown 来说是不可能的。作为spec解释(强调):

The remainder of the table’s rows may vary in the number of cells. If there are a number of cells fewer than the number of cells in the header row, empty cells are inserted. If there are greater, the excess is ignored:

当然,您始终可以退回到原始 HTML。

<table>
    <thead>
        <tr>
            <th>Layer 1</th>
            <th>Layer 2</th>
            <th>Layer 3</th>
        </tr>
    </thead>
    <tbody>
        <tr>
            <td rowspan=4>L1 Name</td>
            <td rowspan=2>L2 Name A</td>
            <td>L3 Name A</td>
        </tr>
        <tr>
            <td>L3 Name B</td>
        </tr>
        <tr>
            <td rowspan=2>L2 Name B</td>
            <td>L3 Name C</td>
        </tr>
        <tr>
            <td>L3 Name D</td>
        </tr>
    </tbody>
</table>

亲自尝试一下 https://jsfiddle.net/7h89y55r/

关于github - 我可以在 Markdown 中合并表格行吗,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/46621765/

相关文章:

git - 如何将子分支推送到分支?

python - 是否可以使用 github.io 在 Web 中运行 python?

Vim 换行与 Markdown 冲突

latex - 如何在 Pandoc Markdown 中使用 Latex 方程环境?

r - 如何使用 knitr 生成 GitHub 风格的 Markdown 文件?

git - 是否可以告诉 Github 我的分支已 merge 到上游 master 中?

尝试从 Visual Studio 2015 提交时出现 Git 错误(文件 opensdf)

php - 延长 Markdown ?

markdown - mkdocs 导航标题与页面标题不同

github - 访问 Github wiki/Markdown 中登录的用户名