CSS display table width 100% cells - HTML CSS CSS Widget

HTML CSS examples for CSS Widget:Table Cell

Description

CSS display table width 100% cells

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">
.tbl {<!--from w  w w  .j av a 2 s .  c o  m-->
   display:table;
   border:2px solid Chartreuse;
   width:100%;
}

.t1,
.t2 {
   display:table-cell;
   white-space:nowrap;
}

.t1 {
   background:red;
   width:100%;
}

.t2 {
   background:yellow;
}

.t11 {
   display:table-cell;
   background:red;
   width:100%;
}
</style> 
 </head> 
 <body> 
  <div class="tbl"> 
   <div class="t1">
     Lorem ip 
   </div> 
   <div class="t2">
     Lorem ipsum do 
   </div> 
  </div> 
  <div class="tbl"> 
   <div class="t11">
     Lorem ip 
   </div> 
   <div class="t2">
     Lorem ipsum do 
   </div> 
  </div>  
 </body>
</html>

Related Tutorials