End of overflow away from table

0

I have a table with style="overflow: auto; , but the scroll is down there, almost 1 finger away from the table.

<div style="overflow: scroll; height: 240px; width: 1000px;">
    <table border="1" class="table table-bordered" id="tabela" style="background-color: white;"> 
                            
         <tr>
             <h5>Usuários</h5>
         </tr>
                            
         <tr>
             <th>Nome</th>
             <th>Nome</th>
         </tr>
         <tr>
             <td>João</td>
             <td>Maria</td>
         </tr>
         <?php endwhile; ?>
    </table>
</div>

Follow the print:

    
asked by anonymous 30.08.2018 / 19:54

1 answer

0

Just remove the fixed height from your table, without it the overflow will always be under the table

<div style="overflow: scroll;width: 1000px">
    <table border="1" class="table table-bordered" id="tabela" style="background-color: white;"> 
                            
         <tr>
             <h5>Usuários</h5>
         </tr>
                            
         <tr>
             <th>Nome</th>
             <th>Nome</th>
         </tr>
         <tr>
             <td>João</td>
             <td>Maria</td>
         </tr>
         <?php endwhile; ?>
    </table>
</div>
    
30.08.2018 / 20:27