【问题标题】:How to get the width of output cell of Jupyter notebook?如何获得 Jupyter notebook 输出单元格的宽度?
【发布时间】:2021-01-04 18:49:13
【问题描述】:

我正在创建一个自定义小部件 (ipywidget),我需要在运行时获取 Jupyter 笔记本的输出单元格的宽度。这样我的小部件就可以占据最大宽度。

【问题讨论】:

    标签: jupyter-notebook ipywidgets


    【解决方案1】:

    我们可以使用this.el.getBoundingClientRect()获取输出单元格的宽度(以px为单位),它返回以下对象:

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2016-09-06
      • 2019-10-05
      • 2016-10-23
      • 2020-09-03
      • 2018-09-04
      • 1970-01-01
      相关资源
      最近更新 更多