(adsbygoogle = window.adsbygoogle || []).push({ google_ad_client: "ca-pub-8242763509535969", enable_page_level_ads: true }); [JSP] 구구단 :: 깜냥깜냥
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
<%@ 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>MultiplicationTable</title>
</head>
<body>
    <table border="1" cellpadding="10" cellspacing="0">
 
    <td></td>
        <%for(int i=2;i<10;i++){%>
        <th width="100"><%=i%> 단</th> <%} %>
        
</tr>
        <%
            for (int i = 1;  i < 10; i++) {
                out.println("<tr>");
                out.print("<td>");
                out.print(i + "</td>");
                for (int j = 2; j < 10; j++) {
                    out.print("<td>");
                    out.print(i + " X " + j + " = " + i * j + "</td>");
                }
                out.println("</tr>");
            }
        %>
    </table>
</body>
</html>



완성~


 


+ Recent posts