CSS empty-cells

CSSのempty-cellsは、表(テーブル)のセルが空の場合に表示するかどうかを指定するプロパティです。

書式

empty-cells: display

属性値

display
表の空のセルの表示方法を指定します。
意味
show表示する
hide表示しない
inherit継承

初期値

show

適用対象

以下に示す要素に対して、empty-cells プロパティを適用できる。

使用例

<table border="1" style="empty-cells: show">
  <tr>
    <td>first</td>
    <td></td>
  </tr>
  <tr>
    <td></td>
    <td>second</td>
  </tr>
</table>
first
second
<table border="1" style="empty-cells: hide">
  <tr>
    <td>first</td>
    <td></td>
  </tr>
  <tr>
    <td></td>
    <td>second</td>
  </tr>
</table>
first
second

関連記事

参考文献

World Wide Web Consortium (2025) Cascading Style Sheets (CSS) Level 2