How do I add a tooltip (or a mouseover popup) to cells of a datatable, that pulls data from another column?
For example if I display first three columns of mtcars in a datable, how do I display a tooltip with hp (horsepower) data of the car name I am currently hovering over with my mouse?
There are similar questions on how you can display static text as a tooltip, but I can't find a way to display data from another column as a toolptip.
#ui.R
library(shiny)
library(DT)
shinyUI(
mainPanel(
DT::dataTableOutput("tbl")
)
)
#server.R
library(shiny)
library(DT)
shinyServer(function(input, output,session) {
output$tbl = DT::renderDataTable(
datatable(mtcars[, 1:3]))
})