With three columns from the gtcars dataset, let’s create a gt table. First, we’ll add a header part with tab_header(). After that, a caption is added with tab_caption().
gtcars |> dplyr::select(mfr, model, msrp) |> dplyr::slice(1:5) |>gt() |>tab_header(title =md("Data listing from **gtcars**"),subtitle =md("`gtcars` is an R dataset") ) |>tab_caption(caption =md("**gt** table example."))