Scrollable Table Tbody - HTML CSS CSS Widget

HTML CSS examples for CSS Widget:Table Scroll

Description

Scrollable Table Tbody

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">
thead, tbody {<!-- w  w  w. ja v a2 s .c o  m-->
   display:block;
   border:2px solid Chartreuse;
}

tbody.scrollable {
   height:76px;
   overflow-y:auto;
   width:100px;
}
</style> 
 </head> 
 <body> 
  <table> 
   <thead> 
    <tr> 
     <th>L</th> 
     <th>L</th> 
    </tr> 
   </thead> 
   <tbody> 
    <tr> 
     <td>L</td> 
     <td>L</td> 
    </tr> 
   </tbody> 
   <tbody class="scrollable"> 
    <tr> 
     <td>L</td> 
     <td>L</td> 
    </tr> 
    <tr> 
     <td>L</td> 
     <td>L</td> 
    </tr> 
    <tr> 
     <td>L</td> 
     <td>L</td> 
    </tr> 
    <tr> 
     <td>L</td> 
     <td>L</td> 
    </tr> 
   </tbody> 
  </table>  
 </body>
</html>

Related Tutorials