Use the countrypops dataset to create a gt table. We will only include a few columns and rows from that table. The country_code_2 column has 2-letter country codes in the format required for fmt_flag() and using that function transforms the codes to circular flag icons.
Using countrypops we can generate a table that provides populations every five years for the Benelux countries ("BE", "NL", and "LU"). This requires some manipulation with dplyr and tidyr before introducing the table to gt. With fmt_flag() we can obtain flag icons in the country_code_2 column. After that, we can merge the flag icons into the stub column, generating row labels that have a combination of icon and text.
fmt_flag() works well even when there are multiple country codes within the same cell. It can operate on comma-separated codes without issue. When rendered to HTML, hovering over each of the flag icons results in tooltip text showing the name of the country.