# NOT RUN {
# Use `exibble` to create a gt table;
# add styles with `tab_style()` and
# the `cell_fill()` helper function
tab_1 <-
exibble %>%
dplyr::select(num, currency) %>%
gt() %>%
fmt_number(
columns = vars(num, currency),
decimals = 1
) %>%
tab_style(
style = cell_fill(color = "lightblue"),
locations = cells_body(
columns = vars(num),
rows = num >= 5000)
) %>%
tab_style(
style = cell_fill(color = "gray85"),
locations = cells_body(
columns = vars(currency),
rows = currency < 100
)
)
# }
Run the code above in your browser using DataLab