Hide empty cells in table - HTML CSS CSS Widget

HTML CSS examples for CSS Widget:Table Cell

Description

Hide empty cells in table

Demo Code

ResultView the demo in separate window

<html>
 <head> 
  <meta name="viewport" content="width=device-width, initial-scale=1"> 
 </head> <!--from   w w  w .ja  va  2s  .c  o  m-->
 <body> 
  <style type="text/css">
table.empty {
   width:351px;
   border-collapse:collapse;
   empty-cells:hide;
}

td.normal {
   border-style:solid;
   border-width:2px;
   border-color:Chartreuse;
}

td.empty {
   style:'display=none'
}
</style> 
  <table> 
   <tbody> 
    <tr> 
     <th></th> 
     <th>Lorem ips</th> 
     <th>Lorem ips</th> 
    </tr> 
    <tr> 
     <th>Lorem ips</th> 
     <td class="normal">Lorem</td> 
     <td class="normal">Lorem</td> 
    </tr> 
    <tr> 
     <th>Lorem ips</th> 
     <td class="normal">Lorem</td> 
     <td class="empty"></td> 
    </tr> 
   </tbody> 
  </table>  
 </body>
</html>

Related Tutorials