Странная последняя строка в таблице - PullRequest
0 голосов
/ 13 мая 2019

Я пытаюсь сделать эту линию белой, как и другие, но я не знаю, почему она отличается.Кто-нибудь знает, как я могу поставить это нормально?Я использую «плагин» datatables, чтобы сделать это.

enter image description here

Мой код:

$(document).ready(function() {
  $('#example1').DataTable({
    dom: 'Bfrtip',
    buttons: [
      'excel', 'pdf'
    ]
  });
});
<main align="center">
  <br>
  <br>
  <h2 class="teste">Lista de Utentes</h2>
  <?php $urgencias = DBRead5()?>
  <div class="container">
    <table id="example1" class="table table-striped table-bordered" style="width:70%">
      <thead>
        <th align=center>Utente</th>
        <th align=center>Telefone</th>
        <th align=center>Seguro</th>
        <th align=center>ID de Utente</th>
        <th align=center>Editar</th>
      </thead>
      <?php
            foreach( $urgencias as $cl )
            {?>
        <tr>
          <td align=center>
            <?php echo ($cl['nome']) ?>
          </td>
          <td align=center>
            <?php echo ($cl['telefone']) ?>
          </td>
          <td align=center>
            <?php echo ($cl['seguro']) ?>
          </td>
          <td align=center>
            <?php echo ($cl['idutente']) ?>
          </td>
          <td><a href="alterar.php?id=<?=$cl['idutente']?>">&#9998;</a></td>
        </tr>
        <?php } ?>
        </tbody>
    </table>
    <button type="button" class="criar_urgencia" data-toggle="modal" data-target="#myModal">Criar utente</button>

  </div>
  <br>
</main>

1 Ответ

0 голосов
/ 13 мая 2019

Ну, я бы посоветовал избегать php, просто придерживайтесь JS / CSS / HTML

Я не уверен, что случилось, но добавление CSS style="padding-bottom: 32px" может помочь.

<table id="example1" class="table table-striped table-bordered" style="width:70%; padding-bottom:32px;">

Лучшее решение - display: flex; на родительском элементе, с flex-direction: column, затем поместите flex: 0 0 auto в верхний и нижний колонтитулы, затем flex: 1 0 auto в теле, чтобы оно увеличивалось, чтобы заполнить пространство родителя.Возможно, вам нужен родитель position:relative; height: 100%;


Также вы можете попробовать box-sizing: border-box.Я бы порекомендовал возиться с этим в разделе Стили Chrome devtools

Добро пожаловать на сайт PullRequest, где вы можете задавать вопросы и получать ответы от других членов сообщества.
...