Change number of columns on mouseover - HTML CSS CSS Layout

HTML CSS examples for CSS Layout:Column Layout

Description

Change number of columns on mouseover

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 tr td.single {
   display: none;
}
table tr.single-td td.single {
   display: table-cell;
}
table tr.single-td td.multi {
   display: none;
}


      </style> 
 </head> <!--from   w w  w. j  ava 2s.c  om-->
 <body> 
  <table border="1"> 
   <tbody> 
    <tr onmouseover="this.classList.toggle('single-td')" onmouseout="this.classList.toggle('single-td')"> 
     <td colspan="3" class="single">ABC</td> 
     <td class="multi">A</td> 
     <td class="multi">B</td> 
     <td class="multi">C</td> 
    </tr> 
   </tbody> 
  </table>  
 </body>
</html>

Related Tutorials