There is a block

<h3>Table of counterpartys</h3> <div class="table" > <table border="1" width="1200" cellspacing="0" id="table_firms"> <tr> <th>Name</th><th>Transaction id</th> </tr> <%-firms%> </table> </div> 

I have scrolling in it

 table tr td{ overflow: hidden; } 

But I need to make this scroll appear after a certain number of records (for example, 100) In the frontend is weak, so I ask for help

    1 answer 1

    Try this when adding and removing nodes

     function checkCountRow(parentNode, count){ if(parentNode.childElementCount >= count){ if(parentNode.style.height == ""){ setHeight(parentNode, parentNode.offsetHeight); } } else{ if(parentNode.style.height != ""){ resetHeight(parentNode); } } } function setHeight(node, height){ node.style.height = height + "px"; } function resetHeight(node){ node.style.height = "" }