Column Background : td background « Tags « HTML / CSS






Column Background

    
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <meta http-equiv="content-type" content="text/html; charset=utf-8" />
    <title></title>
<style type="text/css" media="Screen">
#ts td {
  background: white;
}  

#t1 td.c3 {
  background: darkgreen;
  color: white;
} 
</style>
</head>
<body>
<table id="t1"> 
    <tr class="r1 odd"> <td class="c1">r1 c1</td> <td class="c2">c2</td> 
    <td class="c3"> c3</td> <td class="c4">c4</td> </tr> 
    <tr class="r2"> <td class="c1">r2 c1</td> <td class="c2">c2</td> 
    <td class="c3"> c3</td> <td class="c4">c4</td> </tr> 
    <tr class="r3 odd"> <td class="c1">r3 c1</td> <td class="c2">c2</td> 
    <td class="c3"> c3</td> <td class="c4">c4</td> </tr> 
    <tr class="r4"> <td class="c1">r4 c1</td> <td class="c2">c2</td> 
    <td class="c3"> c3</td> <td class="c4">c4</td> </tr> 
    <tr class="r5 odd"> <td class="c1">r5 c1</td> <td class="c2">c2</td> 
    <td class="c3"> c3</td> <td class="c4">c4</td> </tr> 
</table> 

</body>
</html>

   
    
    
  








Related examples in the same category

1.td background-color: gold;
2.Table and table cell backgrounds
3.td background-color:#efefef;
4.th background: lightyellow;
5.td background: url(img/menubg.gif) repeat-x bottom left #f4f4f4;
6.td:empty background: gray;
7.td background: lightyellow;
8.col background: rgb(244, 244, 244);