Is there any way to hide the column names when using the DT::datatable()
That returns now data at all:
empty<-data.frame(c("a","d","d"),c("s","d","d"))
library(DT)
datatable(empty,colnames = F)
Is there any way to hide the column names when using the DT::datatable()
That returns now data at all:
empty<-data.frame(c("a","d","d"),c("s","d","d"))
library(DT)
datatable(empty,colnames = F)
datatable(empty, colnames = c("", ""))
EDIT
datatable(empty, colnames = rep("", ncol(empty)))
To make the code more robust
datatable(empty, colnames = rep("", ncol(empty)),options=list(ordering=F))
–
Kiser Instead of setting blank column names, you can completely remove the header in this way:
library(DT)
datatable(head(iris),
options = list(
headerCallback = JS(
"function(thead, data, start, end, display){",
" $(thead).remove();",
"}")
)
)
datatable(empty, colnames = c("", ""))
EDIT
datatable(empty, colnames = rep("", ncol(empty)))
To make the code more robust
datatable(empty, colnames = rep("", ncol(empty)),options=list(ordering=F))
–
Kiser © 2022 - 2024 — McMap. All rights reserved.