Use exibble to create a gt table. Format the num column as partially numeric and partially in scientific notation (using the num > 500 and num <= 500 expressions in the respective rows arguments).
exibble |>gt() |>fmt_number(columns = num,rows = num >500,decimals =1,scale_by =1/1000,pattern ="{x}K" ) |>fmt_scientific(columns = num,rows = num <=500,decimals =1 )