# NOT RUN {
# Use `exibble` to create a gt table and
# format the data in both columns; with
# `opt_css()` insert CSS rulesets as
# as string and be sure to set the table
# ID explicitly (here as "one")
tab_1 <-
exibble %>%
dplyr::select(num, currency) %>%
gt(id = "one") %>%
fmt_currency(
columns = vars(currency),
currency = "HKD"
) %>%
fmt_scientific(
columns = vars(num)
) %>%
opt_css(
css = "
#one .gt_table {
background-color: skyblue;
}
#one .gt_row {
padding: 20px 30px;
}
#one .gt_col_heading {
text-align: center !important;
}
"
)
# }
Run the code above in your browser using DataLab