I have a table in quarto like this:
library(tidyverse)
library(gt)
Variables<-c("x", "y", "z", )
Description<-c("a", "b", "c")
Expectation<-c("Positive sign", "Negative sign", "Negative sign")
Expectation<-tibble( Variables,
Description,
Expectation)
I would like the text to be aligned at the center, my code is:
Expectation %>% gt() %>%
cols_align(
align="center",
columns=everything()
) %>%
fmt_markdown(columns=everything()) %>%
tab_options(table.width = pct(100))%>%
tab_style(
style = list(
cell_text(align = "center")
),
locations = cells_stub(rows = TRUE)
)
Nevertheless, the output is aligned to the left. Can someone help me with this? Thanks!