表格在我的GitHub Pages网站上不起作用

时间:2018-11-18 12:12:47

标签: github github-pages

我有一个包含三列和多行的表格。该表在存储库中运行良好,但是如果我将.md文件添加到我的GitHub Pages站点,该表将保持原始状态。我知道所有GitHub Pages都将作为.html文件重新生成,并且所有HTML标记都分别在运行。如何在没有HTML标签的情况下投影表?

这有效:

<table>
  <tr>
    <th>var</th>
    <th>let</th>
    <th>const</th>
  </tr>
  <tr>
    <td>
      Declares a variable, optionally initializing it to a value.
    </td>
    <td>
      Declares a block-scoped, local variable, optionally initializing it to a value.
    </td>
    <td>
      Declares a block-scoped, read-only named constant.
    </td>
  </tr>
  ...
</table>

这不是:

## Variable Declarations
| **var** | **let** | **const** |
|-----|-----|-----|
| Declares a variable, optionally initializing it to a value. | Declares a block-scoped, local variable, optionally initializing it to a value. | Declares a block-scoped, read-only named constant. |
| Variable declared by **`var`** must start with a letter, underscore ( _ ) or dollar sign ($) and can contain alphabetic, numeric, or underscore characters. | Variable declared by **`let`** must start with a letter, underscore ( _ ) or dollar sign ($) and can contain alphabetic, numeric, or underscore characters. | Variable declared by **`const`** must start with a letter, underscore ( _ ) or dollar sign ($) and can contain alphabetic, numeric, or underscore characters. |

这里是full source,这里是rendered output供您参考。

1 个答案:

答案 0 :(得分:1)

几乎可以肯定的问题是,您忽略了在表格前放置空白行。尝试以下方法:

## Variable Declarations

| **var** | **let** | **const** |
|-----|-----|-----|
| Declares a variable, optionally initializing it to a value. | Declares a block-scoped, local variable, optionally initializing it to a value. | Declares a block-scoped, read-only named constant. |
| Variable declared by **`var`** must start with a letter, underscore ( _ ) or dollar sign ($) and can contain alphabetic, numeric, or underscore characters. | Variable declared by **`let`** must start with a letter, underscore ( _ ) or dollar sign ($) and can contain alphabetic, numeric, or underscore characters. | Variable declared by **`const`** must start with a letter, underscore ( _ ) or dollar sign ($) and can contain alphabetic, numeric, or underscore characters. |