본문으로 바로가기
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
<%@ page language="java" contentType="text/html; charset=EUC-KR"
    pageEncoding="EUC-KR"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=EUC-KR">
<title>구구단</title>
</head>
<body>
<center><H2>구    구    단</H2>
<table border=1 align="center">
<%
    for(int i=0; i<=9; i++) {
    %>
    <%= "<tr>" %>
    <% for(int j=0; j<=9; j++) {
        if(i==0 && j==0) { %>
        <%= "<td width=70 bgcolor=red align=center></td>" %>
        <% } else if(i==0 && j!=0) { %>
        <%= "<td width=70 bgcolor=red align=center>" + j + "</td>" %>
        <% } else if(i!=0 && j==0) { %>
        <%= "<td width=70 bgcolor=red align=center>" + i + "</td>" %>
        <% } else { %>
        <%= "<td align=center>" + j + "x" + i + "=" + j*+ "</td>" %>
        <% } 
        }
    %>
    <%= "</tr>" %>
<% } %>
</table>
</center>
</body>
</html>
cs






아래는 실행 화면 입니다.