Layout text elements to use a fixed amount of space without using tables - HTML CSS CSS Widget

HTML CSS examples for CSS Widget:Table Text

Description

Layout text elements to use a fixed amount of space without using tables

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 {<!-- w w  w . ja v  a 2 s  .c o m-->
   display:table;
   width:100%;
}

.row {
   display:table-row
}

span {
   display:table-cell;
   text-align:center;
}
</style> 
 </head> 
 <body> 
  <div class="container"> 
   <div class="row"> 
    <span>Lorem </span> 
    <span>Lorem </span> 
    <span>Lorem </span> 
    <span>Lorem </span> 
   </div> 
  </div>  
 </body>
</html>

Related Tutorials