Pregunta

I have a problem with the shiny R package and couldn't find any help on the web so far. I am looking for a possibility to colour the background in a data table which is implemented by dataTableOutput in the ui.R. Is there any option in renderDataTable in server.R to set the background colour of a row in the dataTableOutput. This should be done reactively, so I have indices and the indices referring to certain elements in the data Table should be coloured.

server.R

indices # reactive, let's say 1,5,4,3 and this is referring to the elements cat, mouse, dog, bird  
output$datatable <- renderDataTable(expr = datatable, options = list(???)) # the rows with cat, mouse, dog, bird in the column n should be coloured in a different way

(this is not a minimal working example)

Thanks for your help!

¿Fue útil?

Solución

As far my knowledge says, there is no such scope for changing the background color for the datatable if you use datatable function that comes with the default package of shiny, alternatively you can try some other customized bootstrap themes instead of using the default theme.

At the end you can also try the datatable dTable function that comes with the rCharts packages. The background there is "blue and white" and i think that might suite your need.

Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top