Table-cell with width in % - HTML CSS CSS Widget

HTML CSS examples for CSS Widget:Table Cell

Description

Table-cell with width in %

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">
#container {<!--  www  .  j a v  a 2  s  .  com-->
   width:100%;
   background:Chartreuse;
   display:table-row;
}

#left {
   background:red;
   width:31%;
   display:table-cell;
}

#center {
   background:green;
   width:41%;
   display:table-cell;
}

#right {
   background:red;
   width:31%;
   display:table-cell;
}
</style> 
 </head> 
 <body> 
  <div id="container"> 
   <div id="left">
     Lorem ipsu 
   </div> 
   <div id="center">
     Lorem ipsum 
    <p>Lorem i</p> 
   </div> 
   <div id="left">
     Lorem ipsum 
   </div> 
  </div>  
 </body>
</html>

Related Tutorials