How do I utilize javascript to display the cell value in a tooltip after hovering over a particular cell in a DT::datatable? I decided to hide the long text after a certain width is reached (overflow-x: hidden; white-space: nowrap;
) to maintain a clean format, and I would like the user to be able to see the full text if they choose to hover over a given cell.
datatable(df,
class="compact",
selection="none",
rownames=F,
colnames=NULL,
options=list(dom="t",
pageLength=10
),
escape=F)
Could you try this:
This sets a tooltip for every cell.
To set the tooltip for a single specific cell:
Here is a solution with the newly available plugin ellipsis.
Documentation of the plugin: https://datatables.net/plug-ins/dataRender/ellipsis