Use the exibble dataset to create a gt table with a number of table parts added (using functions like summary_rows(), grand_summary_rows(), and more). Following that, we’ll lessen the amount of vertical padding across the entire table with opt_vertical_padding(). Using a scale value of 0.25 (down from the default of 1) means the vertical space will be greatly reduced, resulting in a more compact table.
exibble |>gt(rowname_col ="row", groupname_col ="group") |>summary_rows(groups ="grp_a",columns =c(num, currency),fns =c("min", "max") ) |>grand_summary_rows(columns = currency,fns = total ~sum(., na.rm =TRUE) ) |>tab_source_note(source_note ="This is a source note.") |>tab_footnote(footnote ="This is a footnote.",locations =cells_body(columns =1, rows =1) ) |>tab_header(title ="The title of the table",subtitle ="The table's subtitle" ) |>opt_vertical_padding(scale =0.25)