HTML DOM emptyCells ÊôÐÔ
¶¨ÒåºÍÓ÷¨
emptyCells ÊôÐÔÉèÖÃÊÇ·ñÏÔʾ±í¸ñÖеĿյ¥Ôª¸ñ£¨½öÓÃÓÚ¡°·ÖÀë±ß¿ò¡±Ä£Ê½£©¡£
Óï·¨£º
Object.style.emptyCells=hide|show
¿ÉÄܵÄÖµ
Öµ | ÃèÊö |
---|---|
hide | ĬÈÏ¡£²»ÔÚ¿Õµ¥Ôª¸ñÖÜΧ»æÖƱ߿ò¡£ |
show | ÔÚ¿Õµ¥Ôª¸ñÖÜΧ»æÖƱ߿ò¡£ |
ʵÀý
±¾Àý¸Ä±ä¿Õµ¥Ôª¸ñµÄÏÔʾ·½Ê½£º
<html>
<head>
<script type="text/javascript">
function showEmptyCells()
{
document.getElementById('myTable').style.emptyCells="show"
}
</script>
</head>
<body>
<table border="1" id="myTable">
<tr>
<td>100</td>
<td>200</td>
</tr>
<tr>
<td>300</td>
<td></td>
</tr>
</table>
<input type="button" onclick="showEmptyCells()"
value="Show empty cells">
</body>
</html>