0

I have a table inside of a popup, I want to fix the header and scroll on the table, any suggestions please

<div id="popupInfo" class="modal hide fade" style="width:30%;left:33%;">
    <div class="modal-body">
        <div style="padding-left:10px">
            <table id="tableInfo" class="table table-bordered table-striped">
                <thead>
                    <tr>
                        <td>.....</td>
                    </tr>
                </thead>
                <tbody>
                </tbody>
            </table>
        </div>
    </div>
</div>

in css

.modal-body {
    position: relative;
    max-height: 400px;
    padding: 15px;
    overflow-y: auto;
}

in js we define tbbody as follow:

$('#info').click(function (e) {
    ..... (definition of variables..)
    $("#popupInfo").modal();
    buff += '<tr>';
    buff += '<td>'++value.description + '</a>' + '</td>';
    buff +=...
});

$('#tableInfo > tbody:first').append(buff); 
    // Here is missing some code.
    error: function(jqXHR, textStatus, errorThrown) {
        // Une erreur s'est produite lors de la requete
        console.log(errorThrown);
    }
});
Great Coder
  • 401
  • 3
  • 13
maya
  • 149
  • 1
  • 12
  • If I understood your problem right, you can find answer here: https://stackoverflow.com/questions/21168521/table-fixed-header-and-scrollable-body – Aleksei Golubev Jun 23 '21 at 15:42

0 Answers0