目录

empty-cells

描述 (Description)

在单独的边框表布局模型中使用empty-cell属性来控制没有可见内容的表格单元格的呈现。

可能的值 (Possible Values)

  • show - 呈现空单元格的边框。

  • hide - 不绘制空单元格的边框。

适用于 (Applies to)

所有元素都带有表格单元格。

DOM语法 (DOM Syntax)

object.style.emptyCell = "hide";

例子 (Example)

这是用于隐藏

元素中空单元格边框的空单元格属性。
<html>
   <head>
      <style type = "text/css">
         table.empty {
            width:350px;
            border-collapse:separate;
            empty-cells:hide;
         }
         td.empty {
            padding:5px;
            border-style:solid;
            border-width:1px;
            border-color:#999999;
         }
      </style>
   </head>
   <body>
      <table class = "empty">
         <tr>
            <th></th>
            <th>Title one</th>
            <th>Title two</th>
         </tr>
         <tr>
            <th>Row Title</th>
            <td class = "empty">value</td>
            <td class = "empty">value</td>
         </tr>
         <tr>
            <th>Row Title</th>
            <td class = "empty">value</td>
            <td class = "empty"></td>
         </tr>
      </table>
   </body>
</html> 

这将产生以下结果 -

新页面打开
↑回到顶部↑
WIKI教程 @2018