Change how empty cells are shown:
function show() {
document.getElementById("myTable").style.emptyCells = "show";
}
function hide() {
document.getElementById("myTable").style.emptyCells = "hide";
}
Try it Yourself »
The emptyCells property sets or returns whether to show the border and background of empty cells, or not.
Property | |||||
---|---|---|---|---|---|
emptyCells | Yes | Yes | Yes | Yes | Yes |
Return the emptyCells property:
object.style.emptyCells
Set the emptyCells property:
object.style.emptyCells = "show|hide|initial|inherit"
Value | Description |
---|---|
show | Border and background are shown in empty cells. This is default |
hide | Border and background are hidden in empty cells |
initial | Sets this property to its default value. Read about initial |
inherit | Inherits this property from its parent element. Read about inherit |
Default Value: | show |
---|---|
Return Value: | A String, representing the border and background of empty cells |
CSS Version | CSS2 |
Return the emptyCells property:
alert(document.getElementById("myTable").style.emptyCells);
Try it Yourself »
CSS tutorial: CSS Table
CSS reference: empty-cells property
截取页面反馈部分,让我们更快修复内容!也可以直接跳过填写反馈内容!