【问题标题】:IPython notebook set width of notebook-panel (web-page)笔记本面板的 IPython 笔记本设置宽度(网页)
【发布时间】:2015-03-29 20:11:44
【问题描述】:

我想将 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 像素大小的水平滚动。所以只有我的单元格的前半部分是可见的。

如果我将width: 2500px; 设置为#notebook#notebook_panel,则水平滚动消失,因此笔记本网页宽度将为2500 像素宽,我看到我的单元格已满,但对齐将居中。为什么?

我也在 Firefox 和 Chrome 中尝试过。

感谢您的帮助!

【问题讨论】:

标签: css width ipython-notebook


【解决方案1】:

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

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

【讨论】:

  • 嘿,这是我根据你的回答,用于修改用户正在使用的 ipython 笔记本的宽度,而不是更改所有笔记本的默认设置:stackoverflow.com/a/34058270/625087
猜你喜欢
  • 2015-06-17
  • 1970-01-01
  • 1970-01-01
  • 2018-09-03
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2015-01-16
  • 1970-01-01
相关资源
最近更新 更多