- HTML中文网
- 联系QQ:88526
- QQ交流群

- 微信公众号

empty-cells属性
含义及用法:
empty-cells 属性设置是否显示表格中的空单元格(仅用于"分离边框"模式)
默认值: | show |
继承: | yes |
版本: | CSS2 |
JavaScript 语法: | object.style.emptyCells="hide" |
浏览器支持:
属性 | ![]() | ![]() | ![]() | ![]() | ![]() |
---|---|---|---|---|---|
empty-cells | yes | yes | yes | yes | yes |
注意:所有主流浏览器都支持empty-cells属性,只有指定!DOCTYPE,IE8才支持empty-cells属性
CSS语法:
empty-cells:hide|show |inherit;
属性值:
值 | 描述 |
hide | 不在空单元格周围绘制边框 |
show | 在空单元格周围绘制边框。默认 |
inherit | 规定应该从父元素继承 empty-cells 属性的值 |
<!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title></title> <style> table { border-collapse:separate; empty-cells:hide; } </style> </head> <body> <table border="1"> <tr> <td>示例一</td> <td>示例一</td> </tr> <tr> <td>示例一</td> <td></td> </tr> </table> </body> </html>
点击 "运行实例" 按钮查看在线实例
效果图:
推荐手册