【问题标题】:Render HTML block in IPYNB?在 IPYNB 中渲染 HTML 块?
【发布时间】:2021-01-07 20:17:43
【问题描述】:

您好,我正在使用 JupyerLab,并希望呈现一段 HTML 格式的文本:

<div style="background: #DFF0D8; border-radius: 3px; padding: 10px;">
   <p><b>Exercise T1 (From the Allen tutorials):</b>

   Use <code>np.array</code> to create a 3-dimensional array with the shape (2, 4, 3).  
   Also, explore how the colon operation works here -- write a sentence on what you find.

</div>

但我收到此错误:

  File "<ipython-input-52-dda4835ea64f>", line 1
  <div style="background: #DFF0D8; border-radius: 3px; padding: 10px;">
  ^
  SyntaxError: invalid syntax

我做错了什么?很确定我的 HTML 语法没问题,这甚至可以在 JupyterLab IPYNB 笔记本中完成吗?

【问题讨论】:

标签: html jupyter-notebook jupyter-lab


【解决方案1】:

你可以改变细胞类型为

  1. 代码
  2. 降价
  3. 原始

选择markdown,就可以渲染HTML了。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2013-09-25
    • 2020-03-10
    • 2022-11-08
    • 2011-06-10
    • 2011-10-22
    相关资源
    最近更新 更多