propriedade HTML DOM Estilo emptyCells
Definição e Uso
emptyCells conjuntos de propriedades ou retorna se para mostrar as células vazias na borda da tabela e do fundo.
gramática
Definindo as propriedades emptyCells:
Object.style.emptyCells="show|hide|inherit"
Voltar emptyCells propriedades:
Object.style.emptyCells
值 | 描述 |
---|---|
show | 显示空单元格的边框和背景,即在空单元格周围绘制边框。 |
hide | 隐藏空单元格的边框和背景,即不在空单元格周围绘制边框。 |
inherit | emptyCells 属性的值从父元素继承。 |
Suporte a navegadores
Todos os principais navegadores suportam emptyCells propriedade.
Nota: Diferente diferentes navegadores padrão.No IE, Chrome e Safari, o valor padrão de "show", enquanto o Firefox e navegador Opera, o valor padrão é "esconder".
Nota: IE7 e versões anteriores não suportam emptyCells propriedade.IE8 só fornece! Tipo de documento suportado emptyCells propriedade. IE9 emptyCells apoio propriedade.
Exemplos
Exemplos
As células vazias para mudar o modo de exibição:
<! DOCTYPE html>
<Html>
<Head>
<Charset Meta = "utf-8">
<Title> Este tutorial (w3big.com) </ title>
<Script>
função show () {
document.getElementById ( "myTable") style.emptyCells = "show" .;
}
hide function () {
. Document.getElementById ( "myTable") style.emptyCells = "hide";
}
</ Script>
</ Head>
<Body>
<Table id = "myTable" border = "1">
<Tr>
<Th> Mês </ th>
<Th> Poupança </ th>
</ Tr>
<Tr>
<Td> Janeiro </ td>
<Td> $ 100 </ td>
</ Tr>
<Tr>
<Td> Fevereiro </ td>
<Td> </ td>
</ Tr>
</ Table>
<br>
<Button type = "button" onclick = "show ()"> exibe células vazias </ button>
<Button tipo = "button" onclick = "hide ()"> Esconder células vazias </ button>
<P> <b> Nota: </ b> 8 e versões anteriores devem apoiar-células vazias propriedade deve ser declarado Internet Explorer DOCTYPE !. </ P>
</ Body>
</ Html>
<Html>
<Head>
<Charset Meta = "utf-8">
<Title> Este tutorial (w3big.com) </ title>
<Script>
função show () {
document.getElementById ( "myTable") style.emptyCells = "show" .;
}
hide function () {
. Document.getElementById ( "myTable") style.emptyCells = "hide";
}
</ Script>
</ Head>
<Body>
<Table id = "myTable" border = "1">
<Tr>
<Th> Mês </ th>
<Th> Poupança </ th>
</ Tr>
<Tr>
<Td> Janeiro </ td>
<Td> $ 100 </ td>
</ Tr>
<Tr>
<Td> Fevereiro </ td>
<Td> </ td>
</ Tr>
</ Table>
<br>
<Button type = "button" onclick = "show ()"> exibe células vazias </ button>
<Button tipo = "button" onclick = "hide ()"> Esconder células vazias </ button>
<P> <b> Nota: </ b> 8 e versões anteriores devem apoiar-células vazias propriedade deve ser declarado Internet Explorer DOCTYPE !. </ P>
</ Body>
</ Html>
tente »
estilo Objects