th background: lightsteelblue; : th background « Tags « HTML / CSS






th background: lightsteelblue;

    

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
                      "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns='http://www.w3.org/1999/xhtml' xml:lang='en'>
    <head>
        <title>:first-child</title>
<style type='text/css'>
body {
    font-size: 12px sans-serif;
}
table {
    background: slateblue;
    color: #fff;
    width: 100%;
    border-collapse: collapse;
    border: 1px solid mediumslateblue;
}
td {
    border: 1px solid darkslateblue;
    padding: 2px;
}
th {
    background: lightsteelblue;
    color: darkslateblue;
    font-size: 18px;
    text-align: left;
}
table tbody tr:first-child td {
    background: mediumslateblue;
}
</style>
    </head>
    <body>
        <h1>Discography</h1>
        <table>
            <thead>
                <tr>
                    <th>Album</th>
                    <th>Year</th>
                </tr>
            </thead>
            <tbody>
                <tr>
                    <td>A</td>
                    <td>March 1963</td>
                </tr>
                <tr>
                    <td>B</td>
                    <td>November 1963</td>
                </tr>
                <tr>
                    <td>C</td>
                    <td>July 1964</td>
                </tr>
                <tr>
                    <td>D</td>
                    <td>December 1964</td>
                </tr>
            </tbody>
        </table>
    </body>
</html>

   
    
    
    
  








Related examples in the same category

1.th background-color: gold;
2.Add background for table header
3.Add background image for table header
4.Add different background images for each table column header
5.Background for table header row
6.table header background-color: #cccccc;
7.th background: #e7e6e6 url(MarketPlace-images/button.jpg) repeat-x;
8.th background: #882D2D;
9.th background: #F3F3F3;
10.th background-color:#d6d6d6;
11.th background-color: #CDC1A7;