简体   繁体   English

如何更改 Jupyter 笔记本单元格左侧部分的宽度?

[英]How do I change the width of Jupyter notebook's cell's left part?

I already increase the width of the jupyter notebook's cell on my browser with this我已经用这个增加了浏览器上 jupyter notebook 单元格的宽度

.container {
    width:100% !important;
}

However, I would also like to narrow the left part of the text cell.但是,我还想缩小文本单元格的左侧部分。

enter image description here在此处输入图片说明

For the above picture I would like shrink the part div.prompt.input_prompt .对于上面的图片,我想缩小部分div.prompt.input_prompt

Is it possible to do it with just css?是否可以仅用 css 来完成? how?怎么样?

Also, if this can be done, how to empty left part automatically for all non-code cells?另外,如果可以这样做,如何为所有非代码单元自动清空左侧部分?

The prompt width is set in notebook/static/notebook/less/cell.less#L80 , so you could do something like:提示宽度在notebook/static/notebook/less/cell.less#L80 中设置,因此您可以执行以下操作:

/* Narrow the prompts */
.prompt {
    min-width: 10ex;
}

/* Hide prompts altogether for non-conda cells */
.cell:not(.code_cell) .prompt {
    display: none;
}

 from IPython.core.display import display, HTML display(HTML("<style>.prompt_container{display:none !important}</style>"))

enter code here it will make left part of the all cell hide and give more space to work Example Here:- enter image description here enter code here它将隐藏所有单元格的左侧部分并提供更多工作空间示例:-在此处输入图像描述

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM