表中奇怪的最后一行

时间:2019-05-13 03:25:50

标签: javascript html 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 :(得分:0)

好吧,我建议您避免使用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样式部分中将其弄乱