If you want to use renderTable
the easiest way to style your table is using css. Removing the row numbers requires passing the option include.rownames = FALSE
to print.xtable
. There is a ...
argument in the renderTable
function that does this. You can include html in your table and use the sanitize.text.function
argument.
runApp(list(
ui = bootstrapPage(
tableOutput("myTable")
, tags$head(tags$style(type="text/css",
"#myTable table th td {
border: 1px solid black !important;
}
#myTable table th
{
background-color:green;
color:white;
}"
))
),
server = function(input, output) {
output$myTable <- renderTable({
temp = c(runif(4),
as.character(tags$a(id = 'myId', href='http://www.example.com', runif(1)))
)
data.frame(date=seq.Date(Sys.Date(), by=1, length.out=5), temp = temp)
}, include.rownames = FALSE, sanitize.text.function = function(x) x)
}
))
Alternatively look at renderDataTable
which allows you to use http://datatables.net/.