CSS :empty-cells的使用於定義詳解

來源:互聯網
上載者:User
在CSS中empty-cells的屬性為規定是否顯示表格中的空儲存格上的邊框和背景。本文詳細介紹下empty-cells的定義和用法、empty-cells的文法、empty-cells的執行個體。

在CSS中empty-cells屬性的作用為:規定是否顯示表格中的空儲存格上的邊框和背景。

empty-cells屬性執行個體

隱藏表格中空儲存格上的邊框和背景:

table  {  border-collapse:separate;  empty-cells:hide;  }

empty-cells定義和用法

empty-cells 屬性設定是否顯示表格中的空儲存格(僅用於“分離邊框”模式)。

注釋:某些版本的 IE 瀏覽器不支援此屬性。

說明

該屬性定義了不包含任何內容的表儲存格如何表示。如果顯示,就會繪製出儲存格的邊框和背景。除非 border-collapse 設定為 separate,否則將忽略這個屬性。

文法:

empty-cells : hide | show

參數:
hide :  隱藏
show :  顯示

說明:

設定或檢索當表格的儲存格無內容時,是否顯示該儲存格的邊框。
只有當表格邊框獨立(例如當border-collapse屬性等於separate時)此屬性才起作用。
目前IE5.5尚不支援此屬性。
對應的指令碼特性為emptyCells。請參閱我編寫的其他書目。

樣本:

table { caption-side: top; width: auto; border-collapse: separate; empty-cells: hide; }
相關文章

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.