Hi Experts,
In order to center all columns
we could use
datatable(head(iris, 20), options = list(
columnDefs = list(list(className = 'dt-center', targets = 1:5)),
pageLength = 5,
lengthMenu = c(5, 10, 15, 20)
))
In order to remove column : 5 we could
datatable(head(iris, 20), options = list(
columnDefs = list(list(targets = 5, visible = FALSE)),
pageLength = 5,
lengthMenu = c(5, 10, 15, 20)
))
But I would center all the column but remove specific columns in the middle
I tried
datatable(head(iris, 20), options = list(
columnDefs = list(list(className = 'dt-center', targets = 1:5)),
columnDefs = list(list(className = 'dt-center', targets = 5, visible = FALSE)),
pageLength = 5,
lengthMenu = c(5, 10, 15, 20)
))
and
datatable(head(iris, 20), options = list(
columnDefs = list(list(className = 'dt-center', targets = 1:5))
pageLength = 5,
lengthMenu = c(5, 10, 15, 20)
)) %>% (options = list(
columnDefs = list(list(className = 'dt-center', targets = 5, visible = FALSE))
pageLength = 5,
lengthMenu = c(5, 10, 15, 20)
))
But these 2 approaches not producing the expected result.
Could some one help me