CSS table in scrollable div - HTML CSS CSS Widget

HTML CSS examples for CSS Widget:Div Table

Description

CSS table in scrollable div

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">
div {<!--from w w w  . jav a 2  s  .com-->
   display:inline-block;
   width:100px;
   height:100px;
   background:blue;
   overflow:scroll;
}

table {
   table-layout:fixed;
   background:red;
   margin-bottom:21px;
   margin-right:21px;
   padding-left:24px;
}

td {
   min-width:151px;
   max-width:151px;
}
</style> 
 </head> 
 <body> 
  <div> 
   <table> 
    <tbody> 
     <tr> 
      <td>L</td> 
     </tr> 
     <tr> 
      <td>L</td> 
     </tr> 
     <tr> 
      <td>L</td> 
     </tr> 
     <tr> 
      <td>L</td> 
     </tr> 
    </tbody> 
   </table> 
  </div>  
 </body>
</html>

Related Tutorials