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)
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
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With