gpt4 book ai didi

css - IPython笔记本设置笔记本面板的宽度(网页)

转载 作者:行者123 更新时间:2023-11-28 11:35:44 29 4
gpt4 key购买 nike

我想将我的 IPython 笔记本的宽度设置为 2500 像素,并且我希望它左对齐。我该怎么做?

我使用这段代码来应用我自己的 CSS:

from IPython.core.display import HTML
def css_styling():
styles = open("./example.css", "r").read()
return HTML(styles)
css_styling()

我的CSS内容是:

<style>
div #notebook { /* centre the content */
float: left;
width: auto;}
div #notebook_panel { /* main background */
float: left;
width: auto;}
div.cell { /* set cell width to about 80 chars */
width: 2000px;}
</style>

如果我使用此 CSS 运行 IPython 脚本,那么我的笔记本网页将向左对齐并且单元格的宽度为 2000 像素,但网页变为可水平滚动,大小约为 1000 像素。所以只有我的细胞的前半部分是可见的。

如果我在 #notebook#notebook_panel 设置 width: 2500px; 然后水平滚动消失所以笔记本网页宽度将宽度为 2500 像素,我看到我的所有单元格,但对齐方式将居中。为什么?

我也在 Firefox 和 Chrome 中尝试过。

感谢您的帮助!

最佳答案

这是解决方案:How do I increase the cell width of the Jupyter/ipython notebook in my browser?

<style>
.container { width:100% !important; }
</style>

关于css - IPython笔记本设置笔记本面板的宽度(网页),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/28234411/

29 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com