empty-cells property in CSS

It is used to hide the border and the background on the empty cells in the table.


<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
<style type="text/css">
table
{
border-collapse:separate;
empty-cells:hide;
}
</style>
</head>
<body>
<table border="2">
<tr>
<td>mahak</td>
<td>garg</td>
</tr>
<tr>
<td></td>
<td>gupta</td>
</tr>
<tr>
<td>ashima</td>
<td></td>
</tr>
</table>
</body>
</html>


Output:


1.png
Ebook Download
View all
Learn
View all