pickerInput is a very useful version of selectInput - it's part of the shinyWidgets package - I find it has better functionality for the purposes of my app.
I should have included shinyWidgets in my code example as a Library - see example below (still not showing whitespace for the pickerInput)
library(shiny)
library(DT)
library(shinyWidgets)
ui = fluidPage(
tags$style(".selectize-control { white-space:pre; }"),
pickerInput(
inputId = "Dictionary",
label = "",
choices = c("Total"," Split_A"," Split_B"," Split_B1"," Split_B2"),
selected = NULL,
multiple = FALSE,
options = list(
`actions-box` = TRUE,`live-search` = TRUE, size = 10
)),
tags$style("#mytable { white-space:pre; }"),
dataTableOutput("mytable")
)
server = function(input, output){
values = data.frame(Demographics = c("Total"," Split_A"," Split_B"," Split_B1"," Split_B2"),check.names = F)
output$mytable <- renderDataTable(values,
selection = 'none',
rownames = FALSE,
escape = FALSE,
editable = T
)
}
shinyApp(ui, server)