library(gtsummary)
<- gtsummary::tbl_summary(gtsummary::trial, by = trt, include = c(age, grade), missing = "always", label = list(age = "Age")) |> add_overall()
tbl
<- tbl$table_body |>
gt_table ::gt(caption = gt::md("This is the caption \n[Used for cross referencing in Quarto]")) |>
gt# Bold cells in table
::tab_style(
gtstyle = gt::cell_text(weight = "bold"),
locations = gt::cells_body(columns = "label", rows = c(1, 3))
)
Text Styling
Testing Text Styling output
gt_save PDF
::gtsave(gt_table, filename = "outputs/pdf/bold_gt_pdf.pdf") gt
rmarkdown rendered PDF
gt_table
gt_save rendered word file
::gtsave(gt_table, filename = "outputs/docx/bold_gt_word.docx") gt
quarto rendered word file
gt_table
rmarkdown rendered word file
gt_table