The cols_move() function

Use countrypops to create a gt table. With the remaining columns, position population after country_name with the cols_move() function.

countrypops |>
  dplyr::select(-contains("code")) |>
  dplyr::filter(country_name == "Mongolia") |>
  tail(5) |>
  gt() |>
  cols_move(
    columns = population,
    after = country_name
  )
country_name population year
Mongolia 3096030 2017
Mongolia 3163991 2018
Mongolia 3232430 2019
Mongolia 3294335 2020
Mongolia 3347782 2021