切り替えたときに開いたままになる可能性のある展開可能な行を持つテーブルを作成したいと考えていました。
長いテキストを含む列を展開可能な行の詳細として配置したかったのです。問題は、反応可能で「詳細」を使用してその列を展開すると、幅が広すぎて画面から外れて読みにくくなることです。拡張可能な行の最大幅を制限して、列が配置されているおおよその場所だけを拡張する方法はありますか?
library(reactable)
library(tidyverse)
library(shiny)
library(tippy)
library(htmltools)
library(webshot)
library(htmlwidgets)
iris2 <- cbind(USArrests[1:32,], mtcars, iris[1:32,])
data2 <- iris2 %>%
mutate(Species = 'This text is long and should only show up entirely when hovering because it is making the shape of my table ugly
and difficult to read when expanded. This text is long and should only show up entirely when hovering because it
is making the shape of my table ugly and difficult to read when expanded.This text is long and should only show
up entirely when hovering because it is making the shape of my table ugly and difficult to read when expanded.
This text is long and should only show up entirely when hovering because it is making the shape of my table ugly
and difficult to read when expanded.')
data <- data2 %>% mutate(Species = word(data2$Species, start =1, end=8, sep = fixed(" ")))
dog2 <- reactable( data,
columns = list(
Species = colDef(details = function(index) {
paste(data2[index, "Species"])
})),
striped = TRUE,
bordered = TRUE)
saveWidget(dog2, "test.html")
どんな助けでも大歓迎です!ありがとうございました!
(私はこの Q と A が役立つことを発見しましたが、R reactable をホバーする代わりに展開可能な行を望んでいました _ how to truncate on cell content and display on hovering? )