如何在JupyterLab中拆分和合并单元格 [英] How to split and merge cells in JupyterLab

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

问题描述

  • JupyterLab 中,给出以下代码单元,如何将其拆分为多个细胞?
  • In JupyterLab, given the following code cell, how may it be split into multiple cells?

  • 同样,给定以下单元格,如何将它们合并为一个单元格?

推荐答案

  • JupyterLab:splitCell
    • JupyterLab: splitCell
      • Source
      • 将光标放在需要拆分的位置,然后按下并释放 ctrl + shift + -
      • 可以通过按住 ctrl 并单击光标所在的位置来放置多个光标.
      • Place cursors where the split is desired, and then press and release ctrl + shift + -
      • Multiple cursors may be placed, by holding ctrl, and clicking the location for the cursor.

      • JupyterLab:mergeCells
        • JupyterLab: mergeCells
          • Source
          • 按住 shift 并单击空白处的[ ],以突出显示所选的单元格,从而选择所需的连续单元格.
          • 在仍然按住 shift 的同时,按 m ,然后释放两个键.
          • Select the desired, consecutive cells, by holding shift, and clicking in the margin, where the [ ] is, which will highlight the selected cells.
          • While still holding shift, press m, and then release both keys.

          • 作为结果的合并单元格,每个单元格的代码之间将有一个空格,此答案中的第一个图像也是如此.
            • 这是预期的行为
            • The resulting merged cell, will have a space between the code from each cell, as does the first image in this answer.
              • This is the expected behavior newModel.value.text = toMerge.join('\n\n');

              这篇关于如何在JupyterLab中拆分和合并单元格的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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