【问题标题】:How to have different widths of code cell and output cell?如何有不同宽度的代码单元和输出单元?
【发布时间】:2021-02-19 15:25:27
【问题描述】:

通过answer,我已经能够独立调整代码单元格和降价单元格的宽度

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

然后我还想保持输出单元格完整,以便我可以显示大图

display(HTML("<style>.jp-OutputArea-output { width: 100% !important;  margin: 0 auto; }</style>"))

不幸的是,它不起作用

能否详细说明如何调整输出单元格的宽度?

更新:我也试过了

display(HTML("<style>.jp-Cell.jp-CodeCell.jp-Cell-inputWrapper { width: 70% !important;  margin: 0 auto; }</style>"))
display(HTML("<style>.jp-Cell.jp-CodeCell.jp-Cell-outputWrapper { width: 100% !important;  margin: 0 auto; }</style>"))

,但他们没有工作。

【问题讨论】:

    标签: python html css python-3.x ipython


    【解决方案1】:

    看来我找到了解决办法

    from IPython.core.display import display, HTML
    display(HTML("<style>.jp-CodeCell .jp-Cell-inputWrapper { width: 80% !important;  margin: 0 auto; }</style>"))
    display(HTML("<style>.jp-MarkdownCell .jp-Cell-inputWrapper { width: 90% !important;  margin: 0 auto; }</style>"))
    display(HTML("<style>.jp-Cell-outputWrapper { width: 100% !important;  margin: 0 auto; }</style>"))
    

    【讨论】:

      猜你喜欢
      • 2018-03-31
      • 2012-09-26
      • 1970-01-01
      • 1970-01-01
      • 2016-07-30
      • 2015-11-16
      • 2011-08-20
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多