Latest web development tutorials

HTML DOM Style emptyCells property

Style Object Reference Style Objects

Definition and Usage

emptyCells property sets or returns whether to show empty cells in the table border and background.

grammar

Setting emptyCells properties:

Object.style.emptyCells="show|hide|inherit"

Back emptyCells properties:

Object.style.emptyCells

描述
show 显示空单元格的边框和背景,即在空单元格周围绘制边框。
hide 隐藏空单元格的边框和背景,即不在空单元格周围绘制边框。
inherit emptyCells 属性的值从父元素继承。


Browser Support

Internet ExplorerFirefoxOperaGoogle ChromeSafari

All major browsers support emptyCells property.

Note: Different different browsers default.In IE, Chrome and Safari, the default value of "show", while Firefox and Opera browser, the default value is "hide".

Note: IE7 and earlier versions do not support emptyCells property.IE8 only provides! DOCTYPE supported emptyCells property. IE9 support emptyCells property.


Examples

Examples

Empty cells to change the display mode:

<! DOCTYPE html>
<Html>
<Head>
<Meta charset = "utf-8">
<Title> This tutorial (w3big.com) </ title>
<Script>
function show () {
document.getElementById ( "myTable") style.emptyCells = "show".;
}
function hide () {
. Document.getElementById ( "myTable") style.emptyCells = "hide";
}
</ Script>
</ Head>
<Body>

<Table id = "myTable" border = "1">
<Tr>
<Th> Month </ th>
<Th> Savings </ th>
</ Tr>
<Tr>
<Td> January </ td>
<Td> $ 100 </ td>
</ Tr>
<Tr>
<Td> February </ td>
<Td> </ td>
</ Tr>
</ Table>
<br>
<Button type = "button" onclick = "show ()"> displays empty cells </ button>
<Button type = "button" onclick = "hide ()"> Hide empty cells </ button>
<P> <b> Note: </ b> Internet Explorer 8 and earlier versions should support empty-cells property must be declared DOCTYPE!. </ P>

</ Body>
</ Html>

try it"


Style Object Reference Style Objects