empty-cells property in CSS

It is used to hide the border and the background on the empty cells in the table.
  1. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  2. <html>
  3. <head>
  4. <style type="text/css">
  5. table {
  6. border-collapse: separate;
  7. empty-cells: hide;
  8. }
  9. </style>
  10. </head>
  11. <body>
  12. <table border="2">
  13. <tr>
  14. <td>mahak</td>
  15. <td>garg</td>
  16. </tr>
  17. <tr>
  18. <td></td>
  19. <td>gupta</td>
  20. </tr>
  21. <tr>
  22. <td>ashima</td>
  23. <td></td>
  24. </tr>
  25. </table>
  26. </body>
  27. </html>
Output:
1.png