0
나는 테이블을 시각화하기 위해 DT 라이브러리를 사용하는 반짝 이는 응용 프로그램을 가지고 있습니다. 컨테이너를 사용하여 테이블을 렌더링하고 있습니다.DT에서 ColVis 플러그인을 사용하여 맞춤 컨테이너의 여러 열을 숨기는 방법?
sketch = htmltools::withTags(table(
class = 'display',
thead(
tr(
th(rowspan = 2, 'Name'),
th(rowspan = 2, 'Description'),
th(rowspan = 2, 'From'),
th(rowspan = 2, 'To'),
th(rowspan = 2, 'Duration'),
th(colspan = 3, 'Rain', style="text-align:center"),
th(colspan = 3, 'Flow', style="text-align:center"),
th(colspan = 3, 'Depth', style="text-align:center"),
th(colspan = 3, 'Velocity', style="text-align:center")
),
tr(
lapply(rep(c('Min', 'Max', 'Mean'), 4), th)
)
)))
output$table2 <- DT::renderDataTable({
datatable(eventSelection[[input$options]], class = 'cell-border stripe table-hover', rownames = FALSE, container = sketch,
extensions = 'Buttons', options = list(scrollX = TRUE, dom = 'Bfrtip', buttons = I('colvis'))
) %>%
formatDate(c(3,4), method='toLocaleString') %>%
formatRound(5:17, digits = 3)
})
이 표는 다음과 같습니다
내가 옵션 비는, 흐름, 깊이는, 열 가시성 탭의 속도와 수는 해당 최소, 최대를 숨길 갖고 싶어하고 평균 통계 열을 클릭하면됩니다. 가장 좋은 방법은 무엇일까요?
감사합니다.