<! -- programer: Xiangjun Zhou Assinment: #2 Date: 7/1/99 // -- > <HTML> <HEAD> <TITLE>Assignment 2 </TITLE> </HEAD> <BODY> <SCRIPT language="JavaScript"> <!-- var box; var counter; for (counter=0; counter<100; counter++){ if (counter%25 == 0){ if (counter !=0) { box = confirm("click OK to continue. click CANCEL to stop counter"); } if (box == false) { document.writeln("<h3>Counter stopped.</h3><hr>"); break; } tableify(counter); } } function tableify(count){ var c = count; var c1 = c/25+1; var color = new Array(4); color[0] = "red" color[1] = "blue" color[2] = "gray" color[3] = "cyan" document.writeln("<center><table border=3 width='75%' bgcolor=" + color[c/25] + ">"); document.writeln("<caption><h4>Counter Table " + c1 + "</h4></caption>"); for (i=0; i<25; i++) { if (i%5 == 0) { document.writeln("<tr>"); } document.writeln("<th>" + (++c) + "</th>"); if ((i+1)%5 == 0) { document.writeln("</tr>"); } } document.writeln("</table></center><hr>"); } // --> </SCRIPT> <p align=right>Go back to <a href="index.html">my home</a> <!--#echo banner=\"i\"--> </BODY> </HTML>