Html table like structure without table - HTML CSS CSS Widget

HTML CSS examples for CSS Widget:Table Row

Description

Html table like structure without table

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">
.mainbox {<!--  w  w w .j  av  a 2s.  c  om-->
   max-width:301px;
   margin:auto;
   border:2px solid Chartreuse;
   margin-top:31px;
   display:table;
   table-layout:fixed;
   border-spacing:4px;
   border-collapse:separate;
}

hr {
   border-top:4px solid yellow;
   width:201%;
}

.leftbox {
   border-right:2px solid blue;
   font-size:21px;
   padding:6px;
   min-width:151px;
   display:table-cell;
}

.myhr {
   border-bottom:3px solid pink;
   display:table-row;
   width:201%;
   min-height:31px;
   padding:6px;
}

.rightbox {
   font-size:17px;
   min-width:151px;
   display:table-cell;
}
</style> 
 </head> 
 <body> 
  <div class="mainbox"> 
   <span class="leftbox">Lorem i</span>Lor 
   <span class="rightbox">Lorem ipsum dolor sit amet, consectetur</span> 
   <div class="myhr"> 
    <hr> 
   </div> 
   <span class="leftbox">Lorem i</span>Lor 
   <span class="rightbox">Lorem ip</span> 
  </div>  
 </body>
</html>

Related Tutorials