We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
For now, there is only one link per variable. But if in the future, there is more than one, this code could be helpful:
library(reactable) df <- data.frame( ID = "Link to the right of this text", url1_text = "Pharmaverse Repo", url1 = "https://github.com/pharmaverse/falcon", url2_text = "ddsjoberg forked Repo", url2 = "https://github.com/ddsjoberg/falcon" ) rtbl <- df |> dplyr::select(ID, url1) |> reactable( columns = list( url1 = colDef( name = "URL", cell = function(value, index) { label1 <- df[index, "url1_text"] label2 <- df[index, "url2_text"] url1 <- df[index, "url1"] url2 <- df[index, "url2"] htmltools::div( htmltools::p( htmltools::tags$a(href = url1, target = "_blank", label1) ), htmltools::p( htmltools::tags$a(href = url2, target = "_blank", label2) ) ) } ) ) ) df <- data.frame( link_text = "Template", url1 = "https://www.cnn.com/", url2 = "https://www.bbc.com/news", two_links = NA) reactable(df, columns = list( two_links = colDef(html = TRUE, cell = JS(' function(cellInfo) { const url1 = ${cellInfo.row["url1"]} const url2 = ${cellInfo.row["url2"]} return `<a href="${url1}">cnn</a> <br> <a href="${url2}">bcc</a>` } ')) )) library(tidyverse) tibble( link_text = "Template", link_url = "https://github.com/ddsjoberg/falcon" ) |> mutate( markdown = glue::glue("[{link_text}]({link_url})"), two_links = glue::glue("{markdown}\n\n{markdown}") ) |> gt::gt() |> gt::fmt_markdown()
The text was updated successfully, but these errors were encountered:
No branches or pull requests
For now, there is only one link per variable. But if in the future, there is more than one, this code could be helpful:
The text was updated successfully, but these errors were encountered: