<div class="container-fluid">
  <div class="row">
    <div class="col">
      <p>
        <?=count($villes);?> résultat<?=((count($villes)>1)?"s":"");?>
        &nbsp;|&nbsp;
        <a href="javascript:form(0);" class="icon-plus"> ajouter</a>
      </p>
    </div>
  </div>
  <?php if ($villes): ?>
    <div class="row">
      <div class="col p-0">
        <table class="table table-sm table-striped">
          <thead class="table-dark">
            <tr>
              <th>Cp</th>
              <th>Nom</th>
              <th>&nbsp;</th>
            </tr>
          </thead>
          <tbody>
            <?php foreach ($villes as $key => $ville): ?>
              <tr>
                <td><a href="javascript:form(<?=$ville['id'];?>);"><?=$ville['cp'];?></a></td>
                <td><a href="javascript:form(<?=$ville['id'];?>);"><?=$ville['libel'];?></a></td>
                <td> <button type="button" class="btn btn-sm btn-link icon-cross text-danger text-decoration-none" onclick="javascript:supprime(<?=$ville['id'];?>);"></button> </td>
              </tr>
            <?php endforeach; ?>
          </tbody>
        </table>
      </div>
    </div>
  <?php else: ?>
    <div class="row">
      <div class="col">
        <p>Aucun résultat...</p>
      </div>
    </div>
  <?php endif; ?>
</div>
