Text Styling

Testing Text Styling 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]")) |> 
 # Bold cells in table
  gt::tab_style(
    style = gt::cell_text(weight = "bold"), 
    locations = gt::cells_body(columns = "label", rows = c(1, 3))
  ) 

gt_save PDF

gt::gtsave(gt_table, filename = "outputs/pdf/bold_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/bold_gt_word.docx")

Preview the Output

quarto rendered word file

gt_table

Preview the Output

rmarkdown rendered word file

gt_table

Preview the Output