【问题标题】:How to center a cell in JupyterLab after its width is decreased?宽度减小后如何在 JupyterLab 中将单元格居中?
【发布时间】:2021-02-19 15:04:48
【问题描述】:

通过这个伟大的answer,我可以在 JupyterLab 中调整单元格的宽度。

如果我们可以将单元格居中,结果将是完美的。能否请您详细说明如何做?

【问题讨论】:

    标签: python html css ipython jupyter-lab


    【解决方案1】:

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

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

    但我认为这样的问题可能会适得其反,因为我们已经在 How to horizontally center an element 中完美解释了 CSS 定位。

    【讨论】:

      猜你喜欢
      • 2021-05-22
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2021-07-10
      • 1970-01-01
      • 2023-01-23
      • 1970-01-01
      • 2019-01-01
      相关资源
      最近更新 更多