I have renderTable with url links:
output$url_list <- renderTable({
url_list<-as.data.frame(urls_from_plg_table())
}, sanitize.text.function = function(x) x, target="_blank",
options = list(aLengthMenu = c(5, 30, 50), iDisplayLength = 5))
I want to open the URLs from this table in a new tab from my shiny app.
I try add: target="_blank", but it doesn't work in this way. How can I go about it?
Thank you!
Use a string with the HTML tag in your data.frame. (And don't forget sanitize.text.function = function(x) x
to evaluate your HTML tags as is).
For example :
shiny::runApp(list(
ui = bootstrapPage(
tableOutput("table")
),
server = function(input, output) {
output$table <- renderTable({
urls <- c("http://www.google.fr", "http://www.google.fr")
refs <- paste0("<a href='", urls, "' target='_blank'>GOOGLE</a>")
data.frame(refs)
}, sanitize.text.function = function(x) x)
}
))
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