Data Table Tooltips

Hello,

I am working on trying to implement tooltips for my DataTable and I found out how to link tooltips to the headers, but I want it to be if I hover over a specific cell in a column then the tooltip displays data from another column. How do I do this?

app.layout = dash_table.DataTable(
data=df.to_dict(‘records’),
columns=[{‘id’: c, ‘name’: c} for c in df.columns],

tooltip_header={i: i for i in df.columns},

# Style headers with a dotted underline to indicate a tooltip
style_header={
    'textDecoration': 'underline',
    'textDecorationStyle': 'dotted',
},

Hi @ttucker34 and welcome to the Dash community :slightly_smiling_face:

I recommend using Dash AG Grid instead of DataTable. Here’s a tutorial showing some of the amazing things you can do with Tooltips in the grid (including examples showing data from other columns in the tooltip):

2 Likes

Hi @AnnMarieW just looked into those and love the functionality! Definitely made it easier to accomplish what I wanted!

2 Likes