I have a complex code that generates a big matrix, but here I attach a simple, reproducible example in order to explain clearly what I want: Here\'s the code:
#
You can bind your matrix with two vectors of strings of the HTML tags for numeric inputs (input1 and input2 in my code bellow), and add the sanitize.text.function
to evaluate the HTML tags as is (and not as strings).
For example :
shiny::runApp(list(
ui = basicPage(
tableOutput("My_table")
),
server = function(input, output, session) {
My_table = matrix(
c(1:100),
nrow=20,
ncol=5)
output$My_table <- renderTable({
input1 <- paste0("<input id='a", 1:nrow(My_table), "' class='shiny-bound-input' type='number' style='width: 50px;'>")
input2 <- paste0("<input id='b", 1:nrow(My_table), "' class='shiny-bound-input' type='number' style='width: 50px;'>")
cbind(input1, My_table, input2)
}, sanitize.text.function = function(x) x)
}
))