Table Layout using CSS - HTML CSS CSS Widget

HTML CSS examples for CSS Widget:Table Layout

Description

Table Layout using CSS

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">
.divmain<!--from   w w  w. j a  va 2s  .  c  om-->
 {
   display:table-row;
   padding:13px;
   width:100%
   max-width:100%
}

.divleft
 {
   display:table-cell;
   vertical-align:top;
   padding:2px;
   min-width:26%;
   background-color:Chartreuse;
}

.divright
 {
   display:table-cell;
   vertical-align:top;
   padding:2px;
   max-width:76%;
   background-color:yellow;
}
</style> 
 </head> 
 <body> 
  <div class="divmain"> 
   <div class="divleft"> 
    <label class="label">Lore</label> 
   </div> 
   <input type="text"> 
  </div> 
  <div class="divmain"> 
   <div class="divleft"> 
    <label class="label">Lorem ipsum dolor sit </label> 
    <span class="mand">L</span> 
   </div> 
   <div class="divright"> 
    <label class="label">Lorem ipsum dolor sit ame</label> 
   </div> 
  </div> 
  <div class="divmain"> 
   <div class="divleft"> 
    <label class="label">Lorem ipsum dolor sit amet, consectetur ad</label> 
   </div> 
   <div class="divright"> 
    <input type="text"> 
   </div> 
  </div> 
  <div class="divmain"> 
   <div class="divleft"> 
    <label class="label">Lore</label> 
    <span class="mand">L</span> 
   </div> 
   <div class="divright"> 
    <input type="text"> 
   </div> 
  </div> 
  <div class="divmain"> 
   <div class="divleft"> 
    <label class="label">Lorem ip</label> 
    <span class="mand">L</span> 
   </div> 
   <div class="divright"> 
    <input type="text"> 
   </div> 
  </div>  
 </body>
</html>

Related Tutorials