Div stretched inside table cell overflows vertically - HTML CSS CSS Widget

HTML CSS examples for CSS Widget:Table Cell

Description

Div stretched inside table cell overflows vertically

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_main {<!--  w  ww .j  a v a  2 s .  c o m-->
   border:2px solid Chartreuse;
   border-collapse:collapse;
}

#tbl_inner {
   border:2px solid yellow;
   border-collapse:collapse;
   height:100%;
}

tr.v_align_top {
   vertical-align:top;
}

.normal {
   border-radius:21px 21px 21px 21px;
   border:4px solid blue;
   padding:11px;
}

.vstretch {
   border-radius:21px 21px 21px 21px;
   border:4px solid pink;
   padding:11px;
   display:inline-block;
   height:100%;
}

#col1 {
   background-color:OrangeRed;
   margin:6px;
}

#col2 {
   background-color:grey;
   margin:6px 6px 6px 6px;
   height:100%;
}

#col3 {
   background-color:BlueViolet;
   margin:6px;
}
</style> 
 </head> 
 <body> 
  <table id="tbl_main" border="1" style="width:60%; table-layout:fixed"> 
   <!-- Creates columns of equal width --> 
   <tbody> 
    <tr class="v_align_top"> 
     <td> 
      <nav id="col1" class="normal">
        Lorem ipsum dolor sit amet, consectetur adipiscing elit. Morbi ullamcorper molestie lacus sed fermentum. Aliquam erat volutpat. Vestibulum tortor neque, ornare vitae tempor hendrerit, luctus at neque. Phasellus sed quam pharetra, tincidunt tortor in, pharetra nisl. Maecenas aliquam luctus mauris, vitae venenatis diam imperdiet vel. Donec tortor diam, pretium vitae nibh vitae, consectetur lacinia sem. Proin luctus facilisis volutpat. Ut semper sit amet purus quis ornare. Quisque lobortis neque vitae tempor iaculis. Aliquam erat volutpat. Mauris tincidunt eget lacus eget pulvinar. Suspendisse potenti. Maecenas blandi 
      </nav> </td> 
     <td height="100%" style="padding-bottom: 10px"> 
      <nav id="col2" class="vstretch">
        Lorem ipsum dolor sit amet, consectetur adipiscing elit. Morbi ullamcorper molestie lacus sed fermentum. Aliquam erat volutpat. Vestibulum tortor neque, ornare vitae tempor hendrerit, luctus at neque. Phasellus sed quam pharetra, tincidunt tortor in, pharetra nisl. Maecenas aliquam luctus mauris, vitae venenatis diam imperdiet vel. Donec t 
      </nav> </td> 
     <td> 
      <nav id="col3" class="normal">
        Lorem ipsum dolor sit amet, consectetur adipiscing elit. Morbi ullamcorper molestie lacus sed fermentum. Aliquam erat volutpat. Vestibulum tortor neque, ornare vitae tempor hendrerit, luctus at neque. Phasell 
      </nav> </td> 
    </tr> 
   </tbody> 
  </table>  
 </body>
</html>

Related Tutorials