Alignment

Testing Alignments output

library(gtsummary)
tbl <- gtsummary::tbl_summary(gtsummary::trial, by = trt, include = c(age, grade), missing = "always", label = list(age = "Age")) |> add_overall()

gt_table <- tbl$table_body |> 
  gt::gt(caption = gt::md("This is the caption  \n[Used for cross referencing in Quarto]")) |> 
  gt::cols_align(columns = c(stat_1, stat_2), align = "right") |> 
  gt::cols_align(columns = c(variable, var_type), align = "center") |>
  gt::cols_align(columns = c(row_type, var_label), align = "left")

gt_save PDF

gt::gtsave(gt_table, filename = "outputs/pdf/alignment_gt_pdf.pdf")

Preview the Output

rmarkdown rendered PDF

gt_table

Preview the Output

gt_save rendered word file

gt::gtsave(gt_table, filename = "outputs/docx/alignment_gt_word.docx")

Preview the Output

quarto rendered word file

gt_table

Preview the Output

rmarkdown rendered word file

gt_table

Preview the Output