I am including gt tables in a Tufte-style HTML. I want to align the gt tables left so that they are in the main column, rather than down the center of the HTML spanning both the main column and margin. I have tried using the fig.align knitr option but it is not working. Here is the r code chunk for the gt table, as well as the tufte formatting I am using.
title: "Rubin Causal Model"
output:
tufte::tufte_html:
tufte_variant: "envisioned"
tufte::tufte_handout: default
library(tufte)
library(gt)
library(tidyverse)
# First, we create a tibble with the values we want for the table
tibble(subject = "Joe",
ytreat = "13",
ycontrol = "9",
ydiff = "+4") %>%
# Then, we use the gt function to make it pretty
gt() %>%
cols_label(subject = md("**Subject**"),
ytreat = "Attitude if Treated",
ycontrol = "Attitude if Control",
ydiff = "Treatment Effect") %>%
tab_style(cell_borders(sides = "right"),
location = cells_body(columns = vars(subject))) %>%
tab_style(cell_text(weight = "bold"),
location = cells_body(columns = vars(subject))) %>%
cols_align(align = "center", columns = TRUE)