Hi all,
Is there a way to color only cell block in DTtable cells. For example the below code will color both cell background and font . But can we color only block where the number resides.
datatable(iris, options = list(pageLength = 5)) %>%
formatStyle('Sepal.Length', color = 'red', backgroundColor = 'orange', fontWeight = 'bold')
Another reprex for reference. This application colors only font. But can we color a only a block of it (Not entire background)
library(shiny)
library(tidyverse)
library(DT)
shinyApp(
ui = fluidPage(
sidebarLayout(
sidebarPanel(
fluidRow(
column(8,dataTableOutput("view"))
)
),
mainPanel(
))),
server = function(input, output, session){
correct <- reactiveValues(num = 7)
wrong <- reactiveValues(num = 4)
skipped <- reactiveValues(num = 9)
togo = 80
output$view <- renderDataTable(datatable(tibble(
Right = correct$num,
Wrong = wrong$num,
Skipped = skipped$num,
ToGo = togo
), options = list(dom = 't')) %>% formatStyle("Right",color=styleEqual(7, "red")) )
}
)