I want to conditionally format rows in tables. If a column has 1 then the column should be highlighted else not. I want to do this in plotly. Data is like:
Name Purchased
a 0
b 1
c 0
d 1
I want to highlight row with name b and d.
I am using the following type of code with plotly:
plot_ly(
type = 'table',
columnwidth = c(100, 100, 100),
columnorder = c(0, 1, 2),
header = list(
values = c(A,B),
align = c("center", "center"),
line = list(width = 1, color = 'black'),
fill = list(color = c("grey", "grey")),
font = list(family = "Arial", size = 14, color = "white")
),
cells = list(
values = rbind(df[[A]],df[[B]]),
align = c("center", "center"),
line = list(color = "black", width = 1),
font = list(family = "Arial", size = 12, color = c("black"))
))
I am writing this code for R shiny app. Please let me know how can I do it.