diff options
author | Peter Bengtsson <mail@peterbe.com> | 2020-12-08 14:40:17 -0500 |
---|---|---|
committer | Peter Bengtsson <mail@peterbe.com> | 2020-12-08 14:40:17 -0500 |
commit | 33058f2b292b3a581333bdfb21b8f671898c5060 (patch) | |
tree | 51c3e392513ec574331b2d3f85c394445ea803c6 /files/zh-cn/web/css/empty-cells | |
parent | 8b66d724f7caf0157093fb09cfec8fbd0c6ad50a (diff) | |
download | translated-content-33058f2b292b3a581333bdfb21b8f671898c5060.tar.gz translated-content-33058f2b292b3a581333bdfb21b8f671898c5060.tar.bz2 translated-content-33058f2b292b3a581333bdfb21b8f671898c5060.zip |
initial commit
Diffstat (limited to 'files/zh-cn/web/css/empty-cells')
-rw-r--r-- | files/zh-cn/web/css/empty-cells/index.html | 118 |
1 files changed, 118 insertions, 0 deletions
diff --git a/files/zh-cn/web/css/empty-cells/index.html b/files/zh-cn/web/css/empty-cells/index.html new file mode 100644 index 0000000000..6098c59ac4 --- /dev/null +++ b/files/zh-cn/web/css/empty-cells/index.html @@ -0,0 +1,118 @@ +--- +title: empty-cells +slug: Web/CSS/empty-cells +tags: + - CSS + - CSS属性 + - CSS表格 +translation_of: Web/CSS/empty-cells +--- +<div>{{CSSRef}}</div> + +<p>CSS中 <strong><code>empty-cells</code></strong> 属性定义了用户端 {{glossary("user agent")}} 应该怎么来渲染表格 {{htmlelement("table")}} 中没有可见内容的单元格的边框和背景。</p> + +<pre class="brush:css no-line-numbers">/* Keyword values */ +empty-cells: show; +empty-cells: hide; + +/* Global values */ +empty-cells: inherit; +empty-cells: initial; +empty-cells: unset; +</pre> + +<p>只有当 {{cssxref("border-collapse")}} 属性值是 <code>separate</code> 时,才会生效。</p> + +<p>{{cssinfo}}</p> + +<h2 id="Syntax" name="Syntax">语法</h2> + +<p><code>empty-cells</code> 的属性值必须是以下取值中的一个。</p> + +<h3 id="Values" name="Values">取值</h3> + +<dl> + <dt><code>show</code></dt> + <dd>边框和背景正常渲染。与普通元素一样。</dd> + <dt><code>hide</code></dt> + <dd>边框和背景被隐藏。</dd> +</dl> + +<h3 id="语法形式">语法形式</h3> + +<pre class="syntaxbox">{{csssyntax}} +</pre> + +<h2 id="Examples" name="Examples">示例</h2> + +<h3 id="HTML">HTML</h3> + +<pre class="brush: html"><table class="table_1"> + <tr> + <td>Moe</td> + <td>Larry</td> + </tr> + <tr> + <td>Curly</td> + <td></td> + </tr> +</table> +<br> +<table class="table_2"> + <tr> + <td>Moe</td> + <td>Larry</td> + </tr> + <tr> + <td>Curly</td> + <td></td> + </tr> +</table> +</pre> + +<h3 id="Specifications" name="Specifications">CSS</h3> + +<pre class="brush: css">.table_1 { + empty-cells: show; +} + +.table_2 { + empty-cells: hide; +} + +td, +th { + border: 1px solid gray; + padding: 0.5rem; +}</pre> + +<h3 id="Result">Result</h3> + +<p>{{ EmbedLiveSample('Examples', '100%', '200') }}</p> + +<h2 id="Specifications" name="Specifications">规范</h2> + +<table class="standard-table"> + <thead> + <tr> + <th scope="col">Specification</th> + <th scope="col">Status</th> + <th scope="col">Comment</th> + </tr> + </thead> + <tbody> + <tr> + <td>{{SpecName('CSS2.1', 'tables.html#empty-cells', 'empty-cells')}}</td> + <td>{{Spec2('CSS2.1')}}</td> + <td>Initial definition.</td> + </tr> + </tbody> +</table> + +<h2 id="Browser_compatibility" name="Browser_compatibility">浏览器兼容性</h2> + +<div> + + +<p>{{Compat("css.properties.empty-cells")}}</p> +</div> |