How to use htmlOutput to report a html table

Hi all, why my code can't run success? How to use library(sjPlot) to create html table in shiny?

library(shiny)
library(sjPlot)

ui <- fluidPage(
    sidebarLayout(
        sidebarPanel(),
        mainPanel(htmlOutput("a"))
    )
)

server <- function(input, output){
  output$a <- renderUI({
    tab_df(iris,title="title",col.header='N',footnote='footnote')
  })
}

# Run the application 
shinyApp(ui = ui, server = server)

When I run the code , the log is "Warning: Error in if: argument is of length zero". I don't know what's wrong with the code.

Thanks.

This topic was automatically closed 54 days after the last reply. New replies are no longer allowed.