0

enter image description here

How to delete the header row in the table? I'm using renderTable to output the table and setting the colnames to empty strings. colnames(df) <- c("", "")

1 Answer 1

1

colnames(df) <- c("","") does not do what you want here. You want colnames = FALSE in your renderTable() call.

no header row with colnames = FALSE

Here is a simple example. Note that the result is the same with or without the colnames<- line. I can reproduce your image with colnames = TRUE

header row present with default colnames argument

library(shiny)
ui <- fluidPage(
    flowLayout(
        mainPanel(
           tableOutput("testTable")
        )
    )
)
server <- function(input, output) {
    dat <- data.frame(a = c(1,2,3),b = c(4,5,6),c = c(7,8,9))
    colnames(dat) <- c("","","")
    output$testTable <- renderTable(dat, colnames = FALSE, bordered = TRUE)
}
shinyApp(ui = ui, server = server)
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.