选项卡中的Bootstrap分页:更改页面更改也是选项卡

I'm having trouble with a bootstrap pagination within a tab : changing the page with a button changes also the tab (the first one of the group is shown). I must click on the accurate tab to show the pagination again.

Here is the code:-

<!--tab 5, "land control"-->
    <div class="tab-pane fade" id="5">
    <div class="col-md-6">
        <p>Land control entity code : <?= $rep2['cod_sssite']; ?></p>
        <p>Site name : <?= $rep2['nomsite']; ?></p>
        <p>Area : <?php echo $fonction->surf_maitrise($codemaitrise);?> ha</p>
    </div>
<!--Gestion des pages dans l'onglet "maîtrise". cf. https://www.w3schools.com/bootstrap/bootstrap_pagination.asp-->
    <div class="example">
    <nav>
        <ul class="pagination"> <!--"pagination" class to create page numbers-->
            <li> <!--Bouton "suivant"-->
                <a href="javascript:void(0)" aria-label="Previous">
                    <span aria-hidden="true">«</span>
                </a>
            </li>
        <?php for ($i = 1 ; $i <= $nb_pages ; $i++) // Creating buttons with page numbers
            {
                echo '<li><a href="site?code=' .$code . '&p=' . $i . '">' . $i . '</a></li>';
            } ?>
            <li> <!--Bouton "Précédent"-->
                <a href="javascript:void(0)" aria-label="Next">
                    <span aria-hidden="true">»</span>
                </a>
            </li>
        </ul>
    </nav>
</div>`

In short : I’ve got a bootstrap pagination in a tab. How to automatically come back to the current tab when I change my page ? (or how to not change tab when I change my page?)

Thanks for advance