# html.Iframe in dash layout

**URL:** <https://community.plotly.com/t/html-iframe-in-dash-layout/5281>\
**Category:** Dash Python\
**Created:** [August 8, 2017, 5:47am UTC](https://community.plotly.com/t/html-iframe-in-dash-layout/5281 "2017-08-08T05:47:08Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Ivan](https://avatars.discourse-cdn.com/v4/letter/i/df788c/32.png) [@Ivan](https://community.plotly.com/u/Ivan)\
**Post date:** [August 8, 2017, 5:47am UTC](https://community.plotly.com/t/html-iframe-in-dash-layout/5281/1 "2017-08-08T05:47:08Z")

</div>

Dear dash creators and users,

Could you please help me with an html.Iframe usage in dash layout. I haven´t found any answer via community yet.

I create  
app.layout = html.Iframe(src = “Trial.html”)

I see the borders of the frame but the site is not loaded and the frame is empty. I tried both absolute and relative paths. If path does not exists it loads the copy of the main site recurcively.

From the pure html file the … works well. Ha ha, even here in forum it regonizes html code.  
What might be the reason that iframe does not work in dash?

The reason why I do it acutally, is the ability to read html code into the main dash site. I faced the problem with big tables: it is much faster to create html-code rather than pack each cell with html.Table, [html.Tr](http://html.Tr), [html.Td](http://html.Td) methods.

May be you have another ideas how to load big tables in to main site with dash? Big table is kind of 20000 x 300 from pandas dataframe. Pandas create html-code in a second and packing with html. methods takes minutes.

Thank you

---

<div class="post-metadata">

**Author:** ![chriddyp](https://sea2.discourse-cdn.com/flex024/user_avatar/community.plotly.com/chriddyp/32/16855_2.png) [@chriddyp](https://community.plotly.com/u/chriddyp)\
**Post date:** [August 8, 2017, 2:29pm UTC](https://community.plotly.com/t/html-iframe-in-dash-layout/5281/2 "2017-08-08T14:29:39Z")

</div>

I believe that setting `src="Trial.html"` will try to serve a file named `Trial.html`. By default, Dash does not serve files. You will need to add a new route to the server to serve that file, like this:

```auto

@server.route('/static/<path:path>')
def serve_static(path):
    root_dir = os.getcwd()
    return flask.send_from_directory(os.path.join(root_dir, 'static'), path)

```

and then place `Trial.html` in that file.

I believe that you can also just put the entire HTML string as `src=`, but I’m not sure.

* * *

> [@Ivan](#):
>
> May be you have another ideas how to load big tables in to main site with dash? Big table is kind of 20000 x 300 from pandas dataframe.

I’m working on some prototypes for an interactive and editable Table component in Dash: [GitHub - plotly/dash-table-experiments: NO LONGER SUPPORTED - use https://github.com/plotly/dash-table instead](https://github.com/plotly/dash-table-experiments). It’ll be a couple more weeks before something is ready.

Just curious, what do you expect to do with a table this large? (Since it’s so big, it’s difficult to scroll through or to manually search for cells)

---

<div class="post-metadata">

**Author:** ![qqzhang](https://avatars.discourse-cdn.com/v4/letter/q/7cd45c/32.png) [@qqzhang](https://community.plotly.com/u/qqzhang)\
**Post date:** [August 6, 2019, 2:06pm UTC](https://community.plotly.com/t/html-iframe-in-dash-layout/5281/3 "2019-08-06T14:06:52Z")

</div>

[https://dash.plot.ly/dash-deployment-server/static-assets](https://dash.plot.ly/dash-deployment-server/static-assets)  
you need to creat a folder named assets and set the \*.html file in it.
