A function also known as a method when in a Class should do one thing and do it well. It should also be easily re-usable and not have to be edited to use it elsewhere. What you have is none of that.
What you will probably discover as the first problem is that you have hard coded the groups which means if you want a group other than uk you now have a problem on your hands. Duplicating the function for every group is not the answer. What you want to do is pass the groups value to the function as a parameter. Now you can use the same function for any group. Same thing goes for the hard-coded table name. There is also no option to specify specific columns. Again you would run into problems with the hard coded column headers and every other hard coded item.
Here is something you get you going towards a dynamic solution. (It's not a cut n paste solution)
$sql = 'YOUR-QUERY-HERE';
$stmt = $db->pdoQuery($sql);
$row = $stmt->fetch(PDO::FETCH_ASSOC);
echo '<H1>No Records Available</H1>';
$data = ;
foreach ($row as $key => $val)
$data[ucwords(str_replace('_', ' ', $key))] = $val;
<table id="myDataTable" class="table table-bordered table-striped table-hover table-sm">
<th><?= join('</th><th>', array_keys($data)) . "</th>\n" ?>
echo "<tr>\n<td>" . join("</td>\n<td>", $row) . "</td>\n";
echo " </tr> \n";
} while ($row = $stmt->fetch(PDO::FETCH_ASSOC));