Python 如何在 Jupyter Notebook 的“降价”单元格中获取制表符空间
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/47061626/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
How to get tab space in 'markdown' cell of Jupyter Notebook
提问by Piyush Pallav
I am writing descriptive ipynb file and need to give output in markdown with space, but unable to add tab space for printing structured data.
我正在编写描述性的 ipynb 文件,需要在带有空格的降价输出中提供输出,但无法添加用于打印结构化数据的制表符空间。
回答by Piyush Pallav
- Type "nbsp" to add a single space.
- Type "ensp" to add 2 spaces.
- Type "emsp" to add 4 spaces.
- Use the non-breaking space (nbsp) 4 times to insert a tab.
- 键入“nbsp”以添加一个空格。
- 键入“ensp”以添加 2 个空格。
- 键入“emsp”以添加 4 个空格。
- 使用不间断空格 (nbsp) 4 次以插入制表符。
eg.
 This is an example.
例如。
 This is an example.
回答by JeremyDouglass
If I understand your question then I don't think this has anything to do with Jupyter cells. For example, are you able to type a tab key into a Stackoverflow question box? Most browsers do not allow tab keys in most dialogs on most websites -- instead, tab switches to the next area.
如果我理解你的问题,那么我认为这与 Jupyter 细胞没有任何关系。例如,您能否在 Stackoverflow 问题框中键入 Tab 键?大多数浏览器不允许在大多数网站的大多数对话框中使用 Tab 键——相反,Tab 键切换到下一个区域。
Some options:
一些选项:
- cut a tab from a text application, paste into a Jupyter cell. (works)
- try using a browser-specific extension, like TabMeansTabfor Chrome or Tabintafor Firefox.
- 从文本应用程序中剪切一个选项卡,粘贴到 Jupyter 单元格中。(作品)
- 尝试使用特定于浏览器的扩展程序,例如适用于 Chrome 的TabMeansTab或适用于 Firefox 的Tabinta。
See also further discussions of typing tab keys in browsers in generalon SuperUser:
另请参阅SuperUser上一般在浏览器中键入 Tab 键的进一步讨论:
回答by pentandrous
I just had this problem and resorted to the following:
我刚刚遇到了这个问题并采取了以下措施:
This is text with $\;\;\;\;\;\;$
some space inserted.
这是$\;\;\;\;\;\;$
插入了一些空格的文本。