<?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: Rendering HTML in ipywidgets output in Data Engineering</title>
    <link>https://community.databricks.com/t5/data-engineering/rendering-html-in-ipywidgets-output/m-p/157793#M54619</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&gt;Got it. Thanks for the additional info.&lt;/P&gt;
&lt;P&gt;Try this..&lt;/P&gt;
&lt;LI-CODE lang="python"&gt;import ipywidgets as widgets
from IPython.display import display

btn = widgets.Button(description="Render HTML")
html = widgets.HTML()

def on_click(_):
    html.value = "OK &amp;lt;b&amp;gt;docs&amp;lt;/b&amp;gt;"

btn.on_click(on_click)
display(widgets.VBox([btn, html]))&lt;/LI-CODE&gt;
&lt;P&gt;This avoids mixing Databricks notebook rendering with widget callback output, which is the part most likely failing here. Should initially show Render HTML button when you execute the cell. When you click that, it should show what you are after. This is from my free edition account.&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Ashwin_DSA_1-1779972631478.png" style="width: 999px;"&gt;&lt;img src="https://community.databricks.com/t5/image/serverpage/image-id/27331i27A20189390B4BAF/image-size/large?v=v2&amp;amp;px=999" role="button" title="Ashwin_DSA_1-1779972631478.png" alt="Ashwin_DSA_1-1779972631478.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;Hope this helps.&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 12:52:37 GMT</pubDate>
    <dc:creator>Ashwin_DSA</dc:creator>
    <dc:date>2026-05-28T12:52:37Z</dc:date>
    <item>
      <title>Rendering HTML in ipywidgets output</title>
      <link>https://community.databricks.com/t5/data-engineering/rendering-html-in-ipywidgets-output/m-p/157759#M54610</link>
      <description>&lt;P&gt;Hi, I am experimenting with IPywidgets on Databricks (company Azure account and Free Edition).&lt;/P&gt;&lt;P&gt;I have an HTML that I would like to render so typically what happens is that simple things like:&lt;/P&gt;&lt;LI-CODE lang="python"&gt;import ipywidgets as widgets

output = widgets.Output()

with output:
    displayHTML(
        """
&amp;lt;h1&amp;gt;This is heading 1&amp;lt;/h1&amp;gt;
&amp;lt;h2&amp;gt;This is heading 2&amp;lt;/h2&amp;gt;
&amp;lt;h3&amp;gt;This is heading 3&amp;lt;/h3&amp;gt;
"""
    )

output&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;Work flawlessly. I have a more complex one, that works fine with:&lt;/P&gt;&lt;LI-CODE lang="python"&gt;with open('testme.html', encoding='utf8') as f:
        some_html = f.read()
displayHTML(some_html)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;But If I do like the above&lt;/P&gt;&lt;LI-CODE lang="python"&gt;output = widgets.Output()

with output:
    displayHTML(some_html)

output&lt;/LI-CODE&gt;&lt;P&gt;It does not work. It gives a message of&lt;/P&gt;&lt;P&gt;"&lt;STRONG&gt;Latest error:&lt;/STRONG&gt;&lt;SPAN&gt;&amp;nbsp;Uncaught ReferenceError: Tabulator is not defined&lt;/SPAN&gt;"&lt;/P&gt;&lt;P&gt;Tabulator is the JS library I use in HTML.. Here is the said HTML&lt;/P&gt;&lt;P&gt;&lt;A href="https://drive.google.com/file/d/1LXqhEDFA5LwRqrhWXGJntitPqv66lCza/view?usp=sharing" target="_blank"&gt;https://drive.google.com/file/d/1LXqhEDFA5LwRqrhWXGJntitPqv66lCza/view?usp=sharing&lt;/A&gt;&lt;/P&gt;&lt;P&gt;My use case is to use IPywidgets controls to change the HTML to be rendered. The code works fine in Jupyterlab and VScodium notebook.&lt;/P&gt;</description>
      <pubDate>Thu, 28 May 2026 04:04:14 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/rendering-html-in-ipywidgets-output/m-p/157759#M54610</guid>
      <dc:creator>vvanag</dc:creator>
      <dc:date>2026-05-28T04:04:14Z</dc:date>
    </item>
    <item>
      <title>Re: Rendering HTML in ipywidgets output</title>
      <link>https://community.databricks.com/t5/data-engineering/rendering-html-in-ipywidgets-output/m-p/157774#M54611</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-1779961863102.png" style="width: 999px;"&gt;&lt;img src="https://community.databricks.com/t5/image/serverpage/image-id/27326i6E37C8421ED39399/image-size/large?v=v2&amp;amp;px=999" role="button" title="Ashwin_DSA_0-1779961863102.png" alt="Ashwin_DSA_0-1779961863102.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&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:51:47 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/rendering-html-in-ipywidgets-output/m-p/157774#M54611</guid>
      <dc:creator>Ashwin_DSA</dc:creator>
      <dc:date>2026-05-28T09:51:47Z</dc:date>
    </item>
    <item>
      <title>Re: Rendering HTML in ipywidgets output</title>
      <link>https://community.databricks.com/t5/data-engineering/rendering-html-in-ipywidgets-output/m-p/157778#M54614</link>
      <description>&lt;P&gt;Unfortunately even this one does not work&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("OK &amp;lt;b&amp;gt;docy&amp;lt;/b&amp;gt;")

btn.on_click(on_click)
display(btn)&lt;/LI-CODE&gt;&lt;P&gt;However this one is fine&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="python"&gt;displayHTML("OK &amp;lt;b&amp;gt;docy&amp;lt;/b&amp;gt;")&lt;/LI-CODE&gt;</description>
      <pubDate>Thu, 28 May 2026 10:19:57 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/rendering-html-in-ipywidgets-output/m-p/157778#M54614</guid>
      <dc:creator>vvanag</dc:creator>
      <dc:date>2026-05-28T10:19:57Z</dc:date>
    </item>
    <item>
      <title>Re: Rendering HTML in ipywidgets output</title>
      <link>https://community.databricks.com/t5/data-engineering/rendering-html-in-ipywidgets-output/m-p/157781#M54615</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&gt;When you say it doesn't work, do you see an error message? Can you also provide more details about the cluster, runtime, browser, and whether you are using dark or light mode? This will help narrow down the problem. Please attach snapshots as well.&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;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 28 May 2026 10:53:29 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/rendering-html-in-ipywidgets-output/m-p/157781#M54615</guid>
      <dc:creator>Ashwin_DSA</dc:creator>
      <dc:date>2026-05-28T10:53:29Z</dc:date>
    </item>
    <item>
      <title>Re: Rendering HTML in ipywidgets output</title>
      <link>https://community.databricks.com/t5/data-engineering/rendering-html-in-ipywidgets-output/m-p/157785#M54617</link>
      <description>&lt;P&gt;I use the Free Databricks version to run the above two snippets&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="vvanag_0-1779968503356.png" style="width: 400px;"&gt;&lt;img src="https://community.databricks.com/t5/image/serverpage/image-id/27328iC44AE8E0FDAC3675/image-size/medium?v=v2&amp;amp;px=400" role="button" title="vvanag_0-1779968503356.png" alt="vvanag_0-1779968503356.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;I clicked the button and nothing appears. Not even an error message, see above.&lt;/P&gt;&lt;P&gt;here is my notebook&lt;/P&gt;&lt;P&gt;&lt;A href="https://dbc-32e2a8b7-339b.cloud.databricks.com/editor/notebooks/242832157166410?o=163957098038127" target="_blank"&gt;https://dbc-32e2a8b7-339b.cloud.databricks.com/editor/notebooks/242832157166410?o=163957098038127&lt;/A&gt;&lt;/P&gt;&lt;P&gt;I use Chromium on Windows 11 x64&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Version 148.0.7778.179 (Official Build) (64-bit)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Waterfox has the same problem.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 28 May 2026 11:48:22 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/rendering-html-in-ipywidgets-output/m-p/157785#M54617</guid>
      <dc:creator>vvanag</dc:creator>
      <dc:date>2026-05-28T11:48:22Z</dc:date>
    </item>
    <item>
      <title>Re: Rendering HTML in ipywidgets output</title>
      <link>https://community.databricks.com/t5/data-engineering/rendering-html-in-ipywidgets-output/m-p/157793#M54619</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&gt;Got it. Thanks for the additional info.&lt;/P&gt;
&lt;P&gt;Try this..&lt;/P&gt;
&lt;LI-CODE lang="python"&gt;import ipywidgets as widgets
from IPython.display import display

btn = widgets.Button(description="Render HTML")
html = widgets.HTML()

def on_click(_):
    html.value = "OK &amp;lt;b&amp;gt;docs&amp;lt;/b&amp;gt;"

btn.on_click(on_click)
display(widgets.VBox([btn, html]))&lt;/LI-CODE&gt;
&lt;P&gt;This avoids mixing Databricks notebook rendering with widget callback output, which is the part most likely failing here. Should initially show Render HTML button when you execute the cell. When you click that, it should show what you are after. This is from my free edition account.&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Ashwin_DSA_1-1779972631478.png" style="width: 999px;"&gt;&lt;img src="https://community.databricks.com/t5/image/serverpage/image-id/27331i27A20189390B4BAF/image-size/large?v=v2&amp;amp;px=999" role="button" title="Ashwin_DSA_1-1779972631478.png" alt="Ashwin_DSA_1-1779972631478.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;Hope this helps.&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 12:52:37 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/rendering-html-in-ipywidgets-output/m-p/157793#M54619</guid>
      <dc:creator>Ashwin_DSA</dc:creator>
      <dc:date>2026-05-28T12:52:37Z</dc:date>
    </item>
  </channel>
</rss>

