输出到 html 时如何增加 jupyter notebook/lab 单元格宽度

How to increase jupyter notebook/lab cell widths when outputting to html

以下命令将创建一个没有代码的 html 文件:

jupyter nbconvert inspect.ipynb --no-input --no-prompt

文件名为 inspect.ipynb,上面的输出为 inspect.html

我想知道如何使输出(不在 jupyter 实验室)中的单元格宽度变宽。

将此单元格放入您的笔记本中:

# 
from IPython.core.display import display, HTML
display(HTML("<style>.container { width:100% !important; }</style>"))

并且运行你命令:

jupyter nbconvert inspect.ipynb --no-input --no-prompt

或者您可以使用 custom.css,但我不确定。请参阅此处的第二个答案 How do I increase the cell width of the Jupyter/ipython notebook in my browser?