Table tbody scroll - HTML CSS CSS Widget

HTML CSS examples for CSS Widget:Table Scroll

Description

Table tbody scroll

Demo Code

ResultView the demo in separate window

<html>
 <head> 
  <meta name="viewport" content="width=device-width, initial-scale=1"> 
  <style id="compiled-css" type="text/css">
table {<!--   ww  w .  j  a  v a2s.c om-->
   border-collapse:collapse;
   width:100%;
}

thead {
   text-align:left;
   display:table;
   float:left;
   width:100%;
}

thead tr {
   display:table-row;
   width:100%;
}

tbody {
   display:block;
   height:121px;
   overflow:auto;
   float:left;
   width:100%;
}

tbody tr {
   display:table;
   width:100%;
}

tbody tr {
   height:19px;
}

tbody td {
   padding:2px 9px;
}

th, td {
   width:26%;
}

tr:after {
   content:".";
   visibility:hidden;
}
</style> 
 </head> 
 <body> 
  <table> 
   <thead> 
    <tr> 
     <th>Lore</th> 
     <th>Lore</th> 
     <th>Lore</th> 
     <th>Lore</th> 
    </tr> 
   </thead> 
   <tbody> 
    <tr> 
     <td>Lor</td> 
     <td>Lor</td> 
     <td>Lor</td> 
     <td>Lor</td> 
    </tr> 
    <tr> 
     <td>Lor</td> 
     <td>Lor</td> 
     <td>Lor</td> 
     <td>Lor</td> 
    </tr> 
    <tr> 
     <td>Lor</td> 
     <td>Lor</td> 
     <td>Lor</td> 
     <td>Lor</td> 
    </tr> 
    <tr> 
     <td>Lor</td> 
     <td>Lor</td> 
     <td>Lor</td> 
     <td>Lor</td> 
    </tr> 
    <tr> 
     <td>Lor</td> 
     <td>Lor</td> 
     <td>Lor</td> 
     <td>Lor</td> 
    </tr> 
    <tr> 
     <td>Lor</td> 
     <td>Lor</td> 
     <td>Lor</td> 
     <td>Lor</td> 
    </tr> 
    <tr> 
     <td>Lor</td> 
     <td>Lor</td> 
     <td>Lor</td> 
     <td>Lor</td> 
    </tr> 
    <tr> 
     <td>Lor</td> 
     <td>Lor</td> 
     <td>Lor</td> 
     <td>Lor</td> 
    </tr> 
   </tbody> 
  </table>  
 </body>
</html>

Related Tutorials