小编Hel*_*ene的帖子

R 可反应_如何截断单元格内容并在悬停时显示?

我在表格中有一些长文本,将其显示为可反应的。我希望长文本被截断,并且仅在悬停在其顶部时才出现。到目前为止,我已经设法截断单元格中的文本,但我无法使悬停起作用。有什么帮助吗?

library(reactable)
library(tidyverse)

reactable(
      iris[1:5, ] %>% mutate(Species = 'This text is long and should only show up entirely when hovering'),
      columns = list(
        Species = colDef(
          html = TRUE,
          style = "
          white-space: nowrap;
          overflow: hidden;
          text-overflow: ellipsis;
          hover: visible")
          )
        )```
Run Code Online (Sandbox Code Playgroud)

html javascript r reactable

4
推荐指数
1
解决办法
1108
查看次数

标签 统计

html ×1

javascript ×1

r ×1

reactable ×1