# NOT RUN {
# Add horizontal border lines for
# all table body rows in `exibble`
tab_1 <-
exibble %>%
gt() %>%
tab_options(row.striping.include_table_body = FALSE) %>%
tab_style(
style = cell_borders(
sides = c("top", "bottom"),
color = "#BBBBBB",
weight = px(1.5),
style = "solid"
),
locations = cells_body(
columns = everything(),
rows = everything()
)
)
# Incorporate different horizontal and
# vertical borders at several locations;
# this uses multiple `cell_borders()` and
# `cells_body()` calls within `list()`s
tab_2 <-
exibble %>%
gt() %>%
tab_style(
style = list(
cell_borders(
sides = c("top", "bottom"),
color = "#FF0000",
weight = px(2)
),
cell_borders(
sides = c("left", "right"),
color = "#0000FF",
weight = px(2)
)
),
locations = list(
cells_body(
columns = vars(num),
rows = is.na(num)
),
cells_body(
columns = vars(currency),
rows = is.na(currency)
)
)
)
# }
Run the code above in your browser using DataLab