Mega Code Archive

 
Categories / JavaScript DHTML / Table
 

Table Cell background Color Example

<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 1 content</td>        <td height="79">Cell 2 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>