<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Problem rendering HTML in IPywidgets in Warehousing &amp; Analytics</title>
    <link>https://community.databricks.com/t5/warehousing-analytics/problem-rendering-html-in-ipywidgets/m-p/157768#M2606</link>
    <description>&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;# This works in Colab&lt;/SPAN&gt;&lt;/DIV&gt;&lt;BR /&gt;&lt;DIV&gt;&lt;SPAN&gt;import&lt;/SPAN&gt;&lt;SPAN&gt; ipywidgets &lt;/SPAN&gt;&lt;SPAN&gt;as&lt;/SPAN&gt;&lt;SPAN&gt; widgets&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;from&lt;/SPAN&gt;&lt;SPAN&gt; IPython.display &lt;/SPAN&gt;&lt;SPAN&gt;import&lt;/SPAN&gt;&lt;SPAN&gt; display, HTML&lt;/SPAN&gt;&lt;/DIV&gt;&lt;BR /&gt;&lt;DIV&gt;&lt;SPAN&gt;with&lt;/SPAN&gt; &lt;SPAN&gt;open&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;'testme.html'&lt;/SPAN&gt;&lt;SPAN&gt;, encoding=&lt;/SPAN&gt;&lt;SPAN&gt;'utf8'&lt;/SPAN&gt;&lt;SPAN&gt;) &lt;/SPAN&gt;&lt;SPAN&gt;as&lt;/SPAN&gt;&lt;SPAN&gt; f:&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; some_html = f.read()&lt;/SPAN&gt;&lt;/DIV&gt;&lt;BR /&gt;&lt;DIV&gt;&lt;SPAN&gt;output = widgets.Output()&lt;/SPAN&gt;&lt;/DIV&gt;&lt;BR /&gt;&lt;DIV&gt;&lt;SPAN&gt;with&lt;/SPAN&gt;&lt;SPAN&gt; output:&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; display(HTML(some_html))&lt;/SPAN&gt;&lt;/DIV&gt;&lt;BR /&gt;&lt;DIV&gt;&lt;SPAN&gt;output&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
    <pubDate>Thu, 28 May 2026 07:44:50 GMT</pubDate>
    <dc:creator>vvanag</dc:creator>
    <dc:date>2026-05-28T07:44:50Z</dc:date>
    <item>
      <title>Problem rendering HTML in IPywidgets</title>
      <link>https://community.databricks.com/t5/warehousing-analytics/problem-rendering-html-in-ipywidgets/m-p/157767#M2605</link>
      <description>&lt;P&gt;The below code works fine in Colab/VSCodium/JupyterNotebook&lt;/P&gt;&lt;LI-CODE lang="python"&gt;import ipywidgets as widgets
from IPython.display import display, HTML

output = widgets.Output()

with output:
    display(HTML(some_html))

output&lt;/LI-CODE&gt;&lt;P&gt;But it does not work in Databricks&lt;/P&gt;&lt;P&gt;&lt;A title="Tabulator based file" href="https://drive.google.com/file/d/1LXqhEDFA5LwRqrhWXGJntitPqv66lCza/view?usp=drive_link" target="_self"&gt;testme.html&lt;/A&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 28 May 2026 07:38:03 GMT</pubDate>
      <guid>https://community.databricks.com/t5/warehousing-analytics/problem-rendering-html-in-ipywidgets/m-p/157767#M2605</guid>
      <dc:creator>vvanag</dc:creator>
      <dc:date>2026-05-28T07:38:03Z</dc:date>
    </item>
    <item>
      <title>Re: Problem rendering HTML in IPywidgets</title>
      <link>https://community.databricks.com/t5/warehousing-analytics/problem-rendering-html-in-ipywidgets/m-p/157768#M2606</link>
      <description>&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;# This works in Colab&lt;/SPAN&gt;&lt;/DIV&gt;&lt;BR /&gt;&lt;DIV&gt;&lt;SPAN&gt;import&lt;/SPAN&gt;&lt;SPAN&gt; ipywidgets &lt;/SPAN&gt;&lt;SPAN&gt;as&lt;/SPAN&gt;&lt;SPAN&gt; widgets&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;from&lt;/SPAN&gt;&lt;SPAN&gt; IPython.display &lt;/SPAN&gt;&lt;SPAN&gt;import&lt;/SPAN&gt;&lt;SPAN&gt; display, HTML&lt;/SPAN&gt;&lt;/DIV&gt;&lt;BR /&gt;&lt;DIV&gt;&lt;SPAN&gt;with&lt;/SPAN&gt; &lt;SPAN&gt;open&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;'testme.html'&lt;/SPAN&gt;&lt;SPAN&gt;, encoding=&lt;/SPAN&gt;&lt;SPAN&gt;'utf8'&lt;/SPAN&gt;&lt;SPAN&gt;) &lt;/SPAN&gt;&lt;SPAN&gt;as&lt;/SPAN&gt;&lt;SPAN&gt; f:&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; some_html = f.read()&lt;/SPAN&gt;&lt;/DIV&gt;&lt;BR /&gt;&lt;DIV&gt;&lt;SPAN&gt;output = widgets.Output()&lt;/SPAN&gt;&lt;/DIV&gt;&lt;BR /&gt;&lt;DIV&gt;&lt;SPAN&gt;with&lt;/SPAN&gt;&lt;SPAN&gt; output:&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; display(HTML(some_html))&lt;/SPAN&gt;&lt;/DIV&gt;&lt;BR /&gt;&lt;DIV&gt;&lt;SPAN&gt;output&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Thu, 28 May 2026 07:44:50 GMT</pubDate>
      <guid>https://community.databricks.com/t5/warehousing-analytics/problem-rendering-html-in-ipywidgets/m-p/157768#M2606</guid>
      <dc:creator>vvanag</dc:creator>
      <dc:date>2026-05-28T07:44:50Z</dc:date>
    </item>
    <item>
      <title>Re: Problem rendering HTML in IPywidgets</title>
      <link>https://community.databricks.com/t5/warehousing-analytics/problem-rendering-html-in-ipywidgets/m-p/157772#M2607</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.databricks.com/t5/user/viewprofilepage/user-id/200323"&gt;@vvanag&lt;/a&gt;,&lt;/P&gt;
&lt;P class="wnfdntf _1ibi0s3f5 _1ibi0s3ce _1ibi0s3ea" data-pm-slice="1 3 []"&gt;What you’re seeing is expected to some extent in Databricks Notebooks.&lt;/P&gt;
&lt;P&gt;Databricks supports ipywidgets, but it doesn’t guarantee full Jupyter or Colab parity, and there are a few documented limitations on&amp;nbsp;how widgets render and behave in notebooks.&lt;/P&gt;
&lt;P&gt;In particular, Databricks notes that some ipywidgets are not supported, widget state is not preserved across notebook sessions, and some widgets or widget outputs may not render correctly in all cases. The docs also specifically note that widgets might not render correctly in dark mode, especially coloured widgets.&lt;/P&gt;
&lt;P&gt;A practical workaround is to avoid routing rich HTML through widgets.Output() and instead render the HTML directly in the notebook using Databricks-native HTML rendering, for example, with displayHTML(...). That works better in Databricks when the main goal is to show HTML rather than keep it inside a widget output container.&lt;/P&gt;
&lt;P&gt;Here is an example.&lt;/P&gt;
&lt;LI-CODE lang="python"&gt;%python
import ipywidgets as widgets
from IPython.display import display

btn = widgets.Button(description="Render HTML")

def on_click(_):
    displayHTML(some_html)

btn.on_click(on_click)
display(btn)&lt;/LI-CODE&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Ashwin_DSA_0-1779961551321.png" style="width: 999px;"&gt;&lt;img src="https://community.databricks.com/t5/image/serverpage/image-id/27325i7708561145FF6710/image-size/large?v=v2&amp;amp;px=999" role="button" title="Ashwin_DSA_0-1779961551321.png" alt="Ashwin_DSA_0-1779961551321.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;The public docs here are the best references: &lt;A href="https://docs.databricks.com/aws/en/notebooks/ipywidgets" rel="noopener noreferrer nofollow" target="_blank"&gt;Databricks ipywidgets documentation&lt;/A&gt; and &lt;A href="https://docs.databricks.com/aws/en/notebooks/notebook-limitations" rel="noopener noreferrer nofollow" target="_blank"&gt;Known limitations of Databricks notebooks&lt;/A&gt;.&lt;/P&gt;
&lt;P&gt;Also curious to know if you are using this&amp;nbsp;on serverless or a cluster-backed notebook?&amp;nbsp;Are you using dark mode?Which Databricks Runtime version are you on? Databricks also notes that some ipywidgets do not work in Databricks Runtime 15.0. Lastly, which browser are you testing in? All of these are called out in the limitations and could be causing this.&lt;/P&gt;
&lt;P class="wnfdntf _1ibi0s3f5 _1ibi0s3ce _1ibi0s3ea"&gt;&lt;SPAN&gt;Hope this helps.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class="p1"&gt;&lt;FONT size="2" color="#FF6600"&gt;&lt;STRONG&gt;&lt;I&gt;If this answer resolves your question, could you mark it as “Accept as Solution”? That helps other users quickly find the correct fix.&lt;/I&gt;&lt;/STRONG&gt;&lt;/FONT&gt;&lt;I&gt;&lt;/I&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 28 May 2026 09:50:13 GMT</pubDate>
      <guid>https://community.databricks.com/t5/warehousing-analytics/problem-rendering-html-in-ipywidgets/m-p/157772#M2607</guid>
      <dc:creator>Ashwin_DSA</dc:creator>
      <dc:date>2026-05-28T09:50:13Z</dc:date>
    </item>
  </channel>
</rss>

