Is there any way to get a hover tool tip working on a shiny data table that has some information, this is possible on graphs but never seen it done before on a data table
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试):
问题:
回答1:
Yes, like this (no need of Shiny):
library(DT)
datatable(head(iris),
options=list(initComplete = JS(c(
"function(settings){",
" var table = settings.oInstance.api();",
" var cell = table.cell(2,2);",
" cell.node().setAttribute('title', 'TOOLTIP CONTENTS');",
"}")))
)
table.cell(2,2)
means the cell at row 2 and column 2; indices start at 0 in Javascript, and the column of row names is taken into account.