<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>Untitled Document</title>
</head>
<body>
<script type="text/javascript">
document.write("<table border='1' width=80%>");
for(i=1;i<=10;i++)
{
switch(i)
{
case 1: case 3: color='yellow';break;
case 2: case 7: color='green';break;
case 4: case 9: color='red';break;
default: color='blue';
}
document.write("<tr bgcolor="+color+">")
for(j=1;j<=5;j++)
document.write("<td>2</td>");
document.write("</tr>")
}
document.write("</table>");
//1,3:vàng 2,7:xanh lá 4,9:đỏ còn lại:xanh dương
</script>
</body>
</html>
0 comments:
Post a Comment