HTML CSS examples for CSS Widget:Div Table
Add a scrollbar to a DIV that contains a table
<html> <head> <meta name="viewport" content="width=device-width, initial-scale=1"> <style id="compiled-css" type="text/css"> div {<!-- w w w. jav a 2 s .co m--> overflow-y:auto; height:100px; } </style> </head> <body> <div class="box"> <table> <tbody> <tr> <td>Lorem i</td> <td>Lorem i</td> <td>Lorem i</td> <td>Lorem i</td> <td>Lorem i</td> </tr> <tr> <td>Lorem i</td> <td>Lorem i</td> <td>Lorem i</td> <td>Lorem i</td> <td>Lorem i</td> </tr> <tr> <td>Lorem i</td> <td>Lorem i</td> <td>Lorem i</td> <td>Lorem i</td> <td>Lorem i</td> </tr> <tr> <td>Lorem i</td> <td>Lorem i</td> <td>Lorem i</td> <td>Lorem i</td> <td>Lorem i</td> </tr> <tr> <td>Lorem i</td> <td>Lorem i</td> <td>Lorem i</td> <td>Lorem i</td> <td>Lorem i</td> </tr> <tr> <td>Lorem i</td> <td>Lorem i</td> <td>Lorem i</td> <td>Lorem i</td> <td>Lorem i</td> </tr> <tr> <td>Lorem i</td> <td>Lorem i</td> <td>Lorem i</td> <td>Lorem i</td> <td>Lorem i</td> </tr> <tr> <td>Lorem i</td> <td>Lorem i</td> <td>Lorem i</td> <td>Lorem i</td> <td>Lorem i</td> </tr> <tr> <td>Lorem i</td> <td>Lorem i</td> <td>Lorem i</td> <td>Lorem i</td> <td>Lorem i</td> </tr> <tr> <td>Lorem i</td> <td>Lorem i</td> <td>Lorem i</td> <td>Lorem i</td> <td>Lorem i</td> </tr> </tbody> </table> </div> </body> </html>