# Two column table

**URL:** <https://community.plotly.com/t/two-column-table/33528>\
**Category:** Dash Python\
**Created:** [January 12, 2020, 10:04pm UTC](https://community.plotly.com/t/two-column-table/33528 "2020-01-12T22:04:19Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Unixmad](https://avatars.discourse-cdn.com/v4/letter/u/ba9def/32.png) [@Unixmad](https://community.plotly.com/u/Unixmad)\
**Post date:** [January 12, 2020, 10:04pm UTC](https://community.plotly.com/t/two-column-table/33528/1 "2020-01-12T22:04:19Z")

</div>

Hi beginner here,

I’m trying to create a table for a Plotly Dash webapp.

From the data in the dataframe I want to create the following table (Two column table, column name on one side, and values on the other):

Column Name | Value

I’m using the logic below but its just giving me a table with one column and stacks values and columns names in the same column.

return html.Table(

```
    # Header

    [html.Tr([html.Tr(col) for col in dataframe.columns])] +

    # Body

    [html.Td([

        html.Td(dataframe.iloc[i][col]) for col in dataframe.columns

    ]) for i in range(min(len(dataframe), max_rows))]

```

For those familiar with html this is what I’m trying to do:

```auto
<table>
<tr>
<td>Column Name:</td>
<td>Values:</td>
</tr>

```

---

<div class="post-metadata">

**Author:** ![Emmanuelle](https://sea2.discourse-cdn.com/flex024/user_avatar/community.plotly.com/emmanuelle/32/7853_2.png) [@Emmanuelle](https://community.plotly.com/u/Emmanuelle)\
**Post date:** [January 12, 2020, 10:14pm UTC](https://community.plotly.com/t/two-column-table/33528/2 "2020-01-12T22:14:29Z")

</div>

Hi @Unixmad, welcome to the forum! Did you take a look at

- the Dash DataTable [https://dash.plot.ly/datatable](https://dash.plot.ly/datatable), an interactive datatable for Dash  
or
- the plotly table trace [https://plot.ly/python/table/](https://plot.ly/python/table/)?

---

<div class="post-metadata">

**Author:** ![Unixmad](https://avatars.discourse-cdn.com/v4/letter/u/ba9def/32.png) [@Unixmad](https://community.plotly.com/u/Unixmad)\
**Post date:** [January 12, 2020, 10:21pm UTC](https://community.plotly.com/t/two-column-table/33528/3 "2020-01-12T22:21:25Z")

</div>

Thanks for pointing me in the right direction.
