Shiny "custom" table


#1

I came across a talk the other day which included this Shiny app as an example:

http://demo.appsilondatascience.com/shiny.semantic/churn/

I’m curious if there is an “easy” way to create a table similar to the “Client’s Info” section in that app? I’m not too concerned with all the extra formatting (e.g. the green ribbon) but what I am interested in is the format of the data in the table with a column of descriptors (e.g. Name, Client Since) and a second column with different data types (text, dates) stacked. This doesn’t seem like something a dataframe + renderDataTable can handle because of the differing data types.

Thanks,
Matt


#2

You may be interested in formattable


#3

Why not just transpose a “normal” table?

Example:

library(shiny)

tbl <- tibble::tibble(
  Name = "John",
  City = "Warsaw",
  `Client since` = date(),
  Rating = 4.5,
  `Monthly spendings` = 2500
)

ui <- fluidPage(
  tableOutput("tbl")
)

server <- function(input, output, session) {
  output$tbl <- renderTable({
    t(tbl)
  }, rownames = TRUE, colnames = FALSE)
}

shinyApp(ui, server)

#4

Thanks! Not sure how I overlooked such a simple way to do this.


#5

Thanks for sharing ! I didnt’ know this package and was exactly looking for a similar tool !