CSS定義表格樣式

來源:互聯網
上載者:User

#dataDiv table {
    margin:0;
    padding:0;
    font-family:arial;
    font-size:inherit; 
    border-collapse:collapse; 
    border:1px solid #7F7F7F;
    width:100%;
    
   

}

/*表頭*/
#dataDiv th {
    text-decoration:none; color:white; vertical-align:bottom;
    padding:4px 10px 4px 10px;
    border-right:1px solid #CBCBCB;
    background-color: #444446;
}

/*連結*/
#dataDiv th a {
    color:white;
    font-weight:bold;
    text-decoration:none;
}

/*行*/
#dataDiv tr {
    width:100%;
    border:1px solid grey;  /*表格內邊框*/
    background-color:white;
}

/*儲存格*/
#dataDiv td {
    padding:4px 10px 4px 10px; border-right:1px solid #CBCBCB; text-align:center;
}

 

/*表格標題*/
#dataDiv caption {
    text-decoration:none; color:#eedf32; vertical-align:top;
    padding:4px 10px 4px 10px;
    border-right:1px solid #CBCBCB;
    background:url('../images/title-1.png') repeat-x 0 0;
    font-weight: bold;
}

注意border-collapse:collapse;是保證在firefox,opera下面細線的關鍵,並且td要加上border要不然裡面就沒有線了。

相關文章

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.