单元格宽度减小后如何在JupyterLab中居中? [英] How to center a cell in JupyterLab after its width is decreased?

查看:154
本文介绍了单元格宽度减小后如何在JupyterLab中居中?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

从这个很棒的

如果我们可以使单元居中,那么结果将是完美的.您能详细说明怎么做吗?

解决方案

添加 margin:0 auto 与JupyterLab 3.0一样:

来自IPython.core.display的

 导入显示,HTMLdisplay(HTML(``< style> .jp-Cell {width:60%!important; margin:0 auto;}</style"''))) 

但是我相信这样的问题可能会适得其反,因为我们已经在以下位置完全解释了CSS的位置:answer, I'm able to adjust the width of cells in JupyterLab.

The result would be perfect if we can center the cells. Could you please elaborate on how to do do?

解决方案

Adding margin: 0 auto works as for JupyterLab 3.0:

from IPython.core.display import display, HTML
display(HTML("<style>.jp-Cell { width: 60% !important; margin: 0 auto; }</style>"))

But I believe that questions like that might be counter productive as we already have the CSS positioning perfectly explained in: How to horizontally center an element.

这篇关于单元格宽度减小后如何在JupyterLab中居中?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆