CSS: Two divs side by side, in auto sizing table cell - HTML CSS CSS Widget

HTML CSS examples for CSS Widget:Table Cell

Description

CSS: Two divs side by side, in auto sizing table cell

Demo Code

ResultView the demo in separate window

<html>
 <head> 
  <meta name="viewport" content="width=device-width, initial-scale=1"> 
  <link rel="stylesheet" type="text/css" href="https://netdna.bootstrapcdn.com/twitter-bootstrap/2.3.1/css/bootstrap-combined.min.css"> 
  <style id="compiled-css" type="text/css">
.table-container {
   width:301px;
}

.row-outline {
   border:2px solid Chartreuse;
}

.values-list {<!--from  w  w  w . j ava  2s .co  m-->
   background-color:yellow;
}

.price {
   background-color:blue;
}

.left {
   display:inline-block;
   float:left;
   background:pink;
   font-size:3em;
   line-height:2.5em;
}

.right {
   display:inline-block;
   float:right;
   background:OrangeRed;
   font-size:2em;
   line-height:3.9em;
}
</style> 
 </head> 
 <body> 
  <div class="table-container"> 
   <table class="table"> 
    <tbody> 
     <tr class="row-outline"> 
      <td class="values-list">Lorem ipsum dolor s</td> 
      <td class="price"> 
       <div class="left">
         Lorem 
       </div> 
       <div class="right">
         Lor 
       </div> </td> 
     </tr> 
    </tbody> 
   </table> 
  </div>  
 </body>
</html>

Related Tutorials