html - 如何在 Markdown 表中编写列表?

可以在 Markdown 表中创建一个列表(项目符号,编号或不编号)。

表格如下所示:

| Tables        | Are           | Cool  |
| ------------- |:-------------:| -----:|
| col 3 is      | right-aligned | $1600 |
| col 2 is      | centered      |   $12 |
| zebra stripes | are neat      |    $1 |

列表如下所示:

* one
* two
* three

我可以以某种方式合并它们吗?

最佳答案

是的,您可以使用 HTML 合并它们。当我在 Github 的 .md 文件中创建表格时,我总是喜欢使用 HTML 代码而不是 markdown。

Github Flavored Markdown支持 .md 文件中的基本 HTML。所以这就是答案:

Markdown 与 HTML 混合:

| Tables        | Are           | Cool  |
| ------------- |:-------------:| -----:|
| col 3 is      | right-aligned | $1600 |
| col 2 is      | centered      |   $12 |
| zebra stripes | are neat      |    $1 |
| <ul><li>item1</li><li>item2</li></ul>| See the list | from the first column|

或纯 HTML:

<table>
  <tbody>
    <tr>
      <th>Tables</th>
      <th align="center">Are</th>
      <th align="right">Cool</th>
    </tr>
    <tr>
      <td>col 3 is</td>
      <td align="center">right-aligned</td>
      <td align="right">$1600</td>
    </tr>
    <tr>
      <td>col 2 is</td>
      <td align="center">centered</td>
      <td align="right">$12</td>
    </tr>
    <tr>
      <td>zebra stripes</td>
      <td align="center">are neat</td>
      <td align="right">$1</td>
    </tr>
    <tr>
      <td>
        <ul>
          <li>item1</li>
          <li>item2</li>
        </ul>
      </td>
      <td align="center">See the list</td>
      <td align="right">from the first column</td>
    </tr>
  </tbody>
</table>

这是它在 Github 上的样子:

https://stackoverflow.com/questions/19950648/

相关文章:

css - iPad Safari 滚动会导致 HTML 元素消失并延迟重新出现

html - 我可以将 CSS 样式应用于元素名称吗?

html - Force to open "Save As..."popup open at tex

jquery - Bootstrap 抛出 Uncaught Error : Bootstrap's

jquery - 使用 jQuery 获取所选选项的索引

css - 如何将 div 与其父级的顶部对齐但保持其内联 block 行为?

javascript - 单选按钮的 OnChange 事件处理程序(输入类型 ="radio")不

html - 在文本区域的占位符属性内插入换行符?

jquery - HTML5 textarea 占位符未出现

html - 您如何确定网站建立在什么技术之上?