<table class="table m-0">
<thead>
<tr>
<th>#</th>
<th>Название</th>
<th>Количество человек</th>
</tr>
</thead>
<tbody>
<?
while($news = mysql_fetch_array($query))
{
?>
<tr class="groups"id="<?echo $news[id];?>">
<th scope="row"><?echo $news[id];?></th>
<th scope="row"><?echo $news[name];?></th>
<th scope="row"><?echo $news[count];?></th>
</tr>
<?
}
?>
</tbody>
</table>
<table class="table m-0">
<thead>
<tr>
<th>#</th>
<th>Название</th>
<th>Количество человек</th>
</tr>
</thead>
<tbody>
<? while($news = mysql_fetch_array($query)) { ?>
<tr class="groups" id="<? echo $news[id]; ?>">
<th scope="row"><? echo $news[id]; ?></th>
<th scope="row"><? echo $news[name]; ?></th>
<th scope="row"><? echo $news[count]; ?></th>
</tr>
<? } ?>
</tbody>
</table>
var id = $('tr.groups:last-child').attr("id");