如何在降价表内写入列表?

Gab*_*vay 176 html markdown github-flavored-markdown

可以在降价表内创建一个列表(子弹,编号或不编号).

表格如下所示:

| Tables        | Are           | Cool  |
| ------------- |:-------------:| -----:|
| col 3 is      | right-aligned | $1600 |
| col 2 is      | centered      |   $12 |
| zebra stripes | are neat      |    $1 |
Run Code Online (Sandbox Code Playgroud)

列表如下所示:

* one
* two
* three
Run Code Online (Sandbox Code Playgroud)

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

Ion*_*zău 229

是的,您可以使用HTML合并它们.当我在.mdGithub的文件中创建表时,我总是喜欢使用HTML代码而不是降价.

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|
Run Code Online (Sandbox Code Playgroud)

或纯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>
Run Code Online (Sandbox Code Playgroud)

这是它在Github上的样子:

  • 这很棒,但是有什么方法可以设置列表的样式吗?删除项目符号、边距等?例如,Github 似乎不接受 `ul` 元素上的 `style="list-style: none"` 标签。 (3认同)

Ami*_*.io 81

如果您想在单元格中使用无子弹列表(或任何其他非标准用法)或更多行 <br />

| Event         | Platform      | Description |
| ------------- |-----------| -----:|
| `message_received`| `facebook-messenger`<br/>`skype`|
Run Code Online (Sandbox Code Playgroud)

  • 这是[降价表中的换行符?](http://stackoverflow.com/q/11700487/1048572)的答案,而不是关于列表的这个问题 (12认同)
  • 可能是因为三年前这是唯一合理的答案?我同意你的看法,今天这是一个更好的答案。 (2认同)
  • @Bergi 我赞成你的建议。;)谷歌搜索让我想到了这个问题,这就是我需要的解决方案。我认为这是可以忍受的(例如非项目列表),所以我把它放在这个地方。 (2认同)
  • 您可以使用HTML实体添加项目符号:&bull; `facebook-messenger` &lt;br/&gt;&bull; Skype (2认同)

Von*_*onC 48

不是我所知道的,因为我所知道的所有降价参考,就像这个,提到:

单元格内容必须仅在一行上

您可以尝试使用Markdown Tables Generator(其示例看起来就像您在问题中提到的那样,所以您可能已经意识到它).

Pandoc

如果您正在使用Pandoc的降价(扩展GitHub Flavored Markdown所基于的John Gruber的降价语法),您可以使用以下任一方法:grid_tables

+---------------+---------------+--------------------+
| Fruit         | Price         | Advantages         |
+===============+===============+====================+
| Bananas       | $1.34         | - built-in wrapper |
|               |               | - bright color     |
+---------------+---------------+--------------------+
| Oranges       | $2.10         | - cures scurvy     |
|               |               | - tasty            |
+---------------+---------------+--------------------+
Run Code Online (Sandbox Code Playgroud)

multiline_tables.

-------------------------------------------------------------
 Centered   Default           Right Left
  Header    Aligned         Aligned Aligned
----------- ------- --------------- -------------------------
   First    row                12.0 Example of a row that
                                    spans multiple lines.

  Second    row                 5.0 Here's another one. Note
                                    the blank line between
                                    rows.
-------------------------------------------------------------
Run Code Online (Sandbox Code Playgroud)


Vec*_*orX 6

另一种解决方案,您可以<br>在表格中添加标签

    |Method name| Behavior |
    |--|--|
    | OnAwakeLogicController(); | Its called when MainLogicController is loaded into the memory , its also hold the following actions :- <br> 1. Checking Audio Settings <br>2. Initializing Level Controller|
Run Code Online (Sandbox Code Playgroud)

在此处输入图片说明