Table Cell background Color Example : Cell : Table : JavaScript DHTML examples (example source code) Organized by topic

JavaScript DHTML
C++
PHP


JavaScript DHTML  »  Table   » [  Cell  ]   
 



Table Cell background Color Example

Please note that some example is only working under IE or Firefox.

    
<html>
<head>
<script>
    function function1() {
        document.all.myTD.bgColor = "red";
    }
    function function2() {
        document.all.myTD.bgColor = "";
    }
</script>
</head>
<body bgcolor="#ccffcc" text="#000000">
<table>
   <tr>
       <td id="myTD" height="79">Cell content</td>
       <td height="79">Cell content</td>
   </tr>
</table>
<input type="button" value="Add background color to Cell 1" onClick="function1();">
<input type="button" value="Remove background colors" onClick="function2();">
</body>
</html>

    
      
      
Related examples in the same category
1.  Table Cell 'background' Example
2.  Delete a Cell
3.  Insert Cell Example
4.  Table cell Index Example
5.  Table cell Spacing Example
6.  Table 'cellPadding' Example
























Home| Contact Us
Copyright 2003 - 04 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.