Overflow text in a <td> overflow to the corresponding <td> in the next row - HTML CSS CSS Layout

HTML CSS examples for CSS Layout:Text

Description

Overflow text in a <td> overflow to the corresponding <td> in the next row

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">
table {<!--from   w  ww  .  j  ava  2 s  . c  om-->
   border:2px solid Chartreuse;
   border-collapse:collapse;
   width:100%;
}

th {
   overflow:visible;
}

td {
   border:2px solid yellow;
   padding:16px;
   height:21px !important;
   overflow:visible;
   position:relative;
}

.overflow {
   position:absolute;
   top:0;
}

th {
   text-align:center;
}
</style> 
 </head> 
 <body> 
  <table> 
   <tbody> 
    <tr> 
     <th>Lorem </th> 
     <th>Lorem i</th> 
    </tr> 
    <tr> 
     <td></td> 
     <td> 
      <div class="overflow">
        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 
      </div> </td> 
    </tr> 
    <tr> 
     <td></td> 
     <td></td> 
    </tr> 
    <tr> 
     <td></td> 
     <td></td> 
    </tr> 
   </tbody> 
  </table>  
 </body>
</html>

Related Tutorials