# Datatable \`tooltip\_data\` argument - request for example

**URL:** <https://community.plotly.com/t/datatable-tooltip-data-argument-request-for-example/36276>\
**Category:** Dash Python\
**Created:** [March 16, 2020, 2:32pm UTC](https://community.plotly.com/t/datatable-tooltip-data-argument-request-for-example/36276 "2020-03-16T14:32:50Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![vlemmy](https://avatars.discourse-cdn.com/v4/letter/v/ecb155/32.png) [@vlemmy](https://community.plotly.com/u/vlemmy)\
**Post date:** [March 16, 2020, 2:32pm UTC](https://community.plotly.com/t/datatable-tooltip-data-argument-request-for-example/36276/1 "2020-03-16T14:32:50Z")

</div>

hi i’ve tried all possible combinations i could think fo but can’t figure out what `tooltip_data` wants passed to it structure-wise, there’s nothing in reference that clears this up.

could someone please post an example of the structure for generating `tooltip_data` structure for multirow multicol table please. which level is the outermost - row or col?, do you need to have a dict attached to each col key, is outermost structure list…? thigns to be grouped by row in lists…?

---

<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:** [March 16, 2020, 10:05pm UTC](https://community.plotly.com/t/datatable-tooltip-data-argument-request-for-example/36276/2 "2020-03-16T22:05:38Z")

</div>

Hi @vlemmy welcome to the forum! I agree that the documentation could be clearer :-(. Here is a working example below (coursesy of @michaelbabyn! )

```auto
import dash
import dash_table
import pandas as pd
import numpy as np

df = pd.read_csv('https://raw.githubusercontent.com/plotly/datasets/master/solar.csv')

tooltip_data = [{ c: {'type': 'text', 'value': str(np.random.random(1)), 'delay':50, 'duration': 3000} for c, d in row.items()} for row in df.to_dict('rows')]

app = dash.Dash( __name__ )

app.layout = dash_table.DataTable(
    id='table',
    columns=[{"name": i, "id": i} for i in df.columns],
    data=df.to_dict('records'),
    tooltip_data=tooltip_data
)

if __name__ == ' __main__':
    app.run_server(debug=True)

```

---

<div class="post-metadata">

**Author:** ![vlemmy](https://avatars.discourse-cdn.com/v4/letter/v/ecb155/32.png) [@vlemmy](https://community.plotly.com/u/vlemmy)\
**Post date:** [March 19, 2020, 8:36am UTC](https://community.plotly.com/t/datatable-tooltip-data-argument-request-for-example/36276/4 "2020-03-19T08:36:07Z")

</div>

thank-you emmanuele, i realise that my problem was not the structure but the fact that i was not converting my numbers to strings as tooltip only accepts text or markdown. i should have read more carefully. thank-you.

---

<div class="post-metadata">

**Author:** ![tbillah](https://avatars.discourse-cdn.com/v4/letter/t/d6d6ee/32.png) [@tbillah](https://community.plotly.com/u/tbillah)\
**Post date:** [April 7, 2020, 1:44pm UTC](https://community.plotly.com/t/datatable-tooltip-data-argument-request-for-example/36276/5 "2020-04-07T13:44:29Z")

</div>

Thanks for your nice example @Emmanuelle, my problem was row vs column order:

> [@Dash DataTable - Tooltips](https://community.plotly.com/t/dash-datatable-tooltips/6327/15):
>
> Hi @chriddyp, I think the error message is okay. Perhaps I should have mentioned, I also tried with square brackets around learning from the error. However, I tried again with what you provided and ran into the following: By the way, I had to adjust your suggestion by inserting one missing square bracket: tooltip\_data = [{'type': 'text', 'value': [f'{r},{c}' for r in df[df.columns[0]].values]} for c in df.columns ]

I got it working now following your example.

---

<div class="post-metadata">

**Author:** ![alokB](https://avatars.discourse-cdn.com/v4/letter/a/d07c76/32.png) [@alokB](https://community.plotly.com/u/alokB)\
**Post date:** [October 5, 2020, 10:43am UTC](https://community.plotly.com/t/datatable-tooltip-data-argument-request-for-example/36276/6 "2020-10-05T10:43:26Z")

</div>

@Emmanuelle is there any example to generate tooltip data using call back and use it in the UI
