python - 在 Github 上的 jupyter 笔记本的表中显示管道

标签 python github jupyter-notebook markdown

我在 Jupyter 笔记本中上传了一个表格(ipynb 文件)。该表包含一些管道“|”,当然它位于 markdown 格式的单元格中。在我本地的 Jupyter 笔记本上看起来很正常:

enter image description here

表格的代码是:

||**hash table**|**direct-address table**|
|:-|:--------------:|:------------------------:|
|Storage requirement|$\Theta(|K|)$|$|U|$|
|Search time| $O(1)$ time for *average-case*|$O(1)$ time for *worst-case*|
|Location of an element with key $k$|slot $h(k)$|slot $k$|

但是,上传到Github后打开它似乎有问题(我怀疑'|'符号有错误):

enter image description here

中心对齐也失败。

如果之前有人问过这个问题,我深表歉意,但我尝试了其他答案:escape-pipe 。不幸的是,他们推荐的 \| 不起作用。 GitHub页面的链接是:this one ,您可以在其中看到编辑后的完整代码。

有人可以帮忙吗?我对 Github 和 Markdown 还很陌生。

最佳答案

我看到了该问题的链接答案,链接问题中的答案不正确,请查看那里的评论!

As of March 2019, in Gitlab Wikis, you still need to use "|" inside the markup code. – knb Mar 22 '19 at 13:52

您应该使用|

如果您不喜欢困惑的字符,请使用这个!

(Although it technically is a different character, you can still use it! [Its width is higher because it is a full-width character.])

全角字符:在键盘上输入,显示。 (注意作为不同字符的额外宽度)
普通管道:输入|,这将显示|,现场示例:“|”。

建议:

您应该使用 | 方法,因为该字符与您想要的完全相同,而不是该字符的不同变体。

关于python - 在 Github 上的 jupyter 笔记本的表中显示管道,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/61940479/

相关文章:

python - VideoCapture 似乎不适用于 Debian - opencv 3.2

jupyter-notebook - Jupyter Notebook 无需代码即可保存为 PDF

r - 通过 devtools install_github 安装 r 包时出现问题

android - 如何在 ADT 中使用 egit 正确忽略目录?

amazon-web-services - Cloudformation 中的 Bash 脚本

jupyter-notebook - 如何在不打开网络浏览器的情况下从终端编辑 jupyter notebook?

python - 升级 AWS Apache Airflow (MWAA) 中的 python 版本

python - 多线程 Python 中的信号处理

python - 将 XPath 与 Scrapy 结合使用

ruby-on-rails - Github API v3 - 获取特定提交的差异