How to add vertical scroll to a table with the head and the fixed footer with CSS or style?

0

I have the following table, where I put the fixed width to the head:

<table id="listado" class="table table-striped table-bordered" style="margin-bottom: 0 !important;">
<thead>
    <tr>
        <th style="width:50px">Campo 1
        </th>
        <th style="width:50px">Campo 2 
        </th>
        <th style="width:54px">Campo 3
        </th>
        <th style="width:60px">Campo 4
        </th>
        <th style="width:32px">Campo 5
        </th>
        <th style="width:243px">Campo 6
        </th>
        <th style="width:114px">Campo 7
        </th>
        <th style="width:56px">Campo 8
        </th>
        <th style="width:132px !important">Campo 9 
        </th>
    </tr>
</thead>
<tfoot>
    <tr>
        <th colspan="9">

        </th>
</tfoot>
<tbody>

    <tr>
        <td>
            <input type="text" class="form-control" >
        <td>
            <input type="text" class="form-control" >
        </td>
        <td>
            <input type="text" class="form-control" >
        </td>
        <td>
            <input type="text" class="form-control" >
        </td>
        <td>
            <input type="text" class="form-control" >
        </td>
        <td>
            <input type="text" class="form-control" >
        </td>
        <td>
            <input type="text" class="form-control" >
        </td>
        <td>
            <input type="text" class="form-control" ></td>
        </td>
        <td>
            <input type="text" class="form-control" ></td>
    </tr>
  <tr><td></td>..........
 ......
 </tr>
</tbody>
</table>

What I would like is to add a vertical scroll from a high or heigth 250px with the fixed header and footer. I have seen some examples, but they do not adapt what I propose. I would like to know how to add the scroll.

    
asked by Danilo 06.01.2017 в 19:32
source

1 answer

1

Try putting on the style

overflow: scroll;

URL of the article: link Read full: Scroll examples in div overflow

    
answered by 06.01.2017 в 19:35