HTML DOM emptyCells 屬性
定義和用法
emptyCells 屬性設(shè)置是否顯示表格中的空單元格(僅用于“分離邊框”模式)。
語(yǔ)法:
Object.style.emptyCells=hide|show
可能的值
值 | 描述 |
---|---|
hide | 默認(rèn)。不在空單元格周圍繪制邊框。 |
show | 在空單元格周圍繪制邊框。 |
實(shí)例
本例改變空單元格的顯示方式:
<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>