我试过了
from IPython.core.display import display, HTML
display(HTML("<style>.container { width:60% !important; }</style>"))
从这个答案。我也试过
%%html
<style>.container { width:60% !important; }</style>
但它们不起作用。
在JupyterLab中对类的名称进行了重新设计,现在更易于理解和预测。对JupyterLab使用以下选择器:
.jp-Cell
更改所有单元格的宽度.jp-Cell.jp-CodeCell
用代码仅更改单元格的宽度.jp-Cell.jp-MarkdownCell
改变降价单元的宽度.jp-Cell.jp-Editor
仅更改编辑器的宽度.jp-OutputArea-output
更改单元格输出的with例如,要使用IPython减小单元的宽度,可以使用:
from IPython.core.display import display, HTML
display(HTML("<style>.jp-Cell { width: 60% !important; }</style>"))
您可以使用DOM检查器(一种目前所有浏览器都提供的工具)(请参阅此处的说明)来检查要修改的特定元素的类名。
本文收集自互联网,转载请注明来源。
如有侵权,请联系 [email protected] 删除。
我来说两句