# Dash table in raw html

**URL:** <https://community.plotly.com/t/dash-table-in-raw-html/54172>\
**Category:** Dash Python\
**Created:** [June 25, 2021, 10:25am UTC](https://community.plotly.com/t/dash-table-in-raw-html/54172 "2021-06-25T10:25:34Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![alecbg](https://avatars.discourse-cdn.com/v4/letter/a/dc4da7/32.png) [@alecbg](https://community.plotly.com/u/alecbg)\
**Post date:** [June 25, 2021, 10:25am UTC](https://community.plotly.com/t/dash-table-in-raw-html/54172/1 "2021-06-25T10:25:34Z")

</div>

Hello,

I know I can render plotly graphs in raw html, can I do the same thing with `dash_table.DataTable` instances?

For example, the following code produces a standalone html file that we can open in a browser

```auto
import plotly.express as px
import pandas as pd

df = pd.DataFrame({'field': ['a', 'b'], 'total': [3, 4]})

fig = px.bar(df, x='field', y='total')

html_output = f"""<html>
<head>
    <script src="https://cdn.plot.ly/plotly-latest.min.js"></script>
</head>
<body>
    <div id='divPlotly'></div>
    <script>
        var plotly_data = {fig.to_json()}
        Plotly.react('divPlotly', plotly_data.data, plotly_data.layout);
    </script>
</body>
</html>
"""

with open('file.html', 'w') as f:
    f.write(html_output)

```

Can I do something similar with a `dash_table.DataTable`? For example, consider

```auto
from dash_table import DataTable
from dash_table.Format import Format, Scheme

INTEGER_FORMAT = Format(precision=2, scheme=Scheme.decimal_integer, group=',')

df = pd.DataFrame({'a': [1, 2, 3], 'b': [2, 1, 3]})

columns = [dict(id=col, name=col,
                type='numeric',
                format=INTEGER_FORMAT,
                hideable=True) for col in df.columns]

table = DataTable(columns=columns,
                  data=df.to_dict('records'),
                  sort_action="native")

```

Is there a way that I can display `table` in a standalone html file?

Many thanks!
