--- for.php
+++ for.php
... | ... | @@ -18,6 +18,7 @@ |
18 | 18 |
?> |
19 | 19 |
<div id='sector'> |
20 | 20 |
<?php |
21 |
+ echo "<h2>" . $i . "단 </h2>"; |
|
21 | 22 |
for($j = 1; $j <= 9; $j++){ |
22 | 23 |
echo $i . "X" . $j . "=" . ($i*$j) . "<br>" ; |
23 | 24 |
} |
+++ for_table.php
... | ... | @@ -0,0 +1,27 @@ |
1 | +<!doctype html> | |
2 | +<html lang="ko"> | |
3 | +<head> | |
4 | + <meta charset="UTF-8"> | |
5 | + <meta name="viewport" | |
6 | + content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0"> | |
7 | + <meta http-equiv="X-UA-Compatible" content="ie=edge"> | |
8 | + <title>for_table</title> | |
9 | + <style> | |
10 | + #page {background-color: antiquewhite; width: 720px; margin: 0 auto;} | |
11 | + table, td {border: 1px black solid;} | |
12 | + </style> | |
13 | +</head> | |
14 | +<body> | |
15 | + <div id="page"> | |
16 | + <table> | |
17 | + <?php for($j = 1; $j <= 10; $j++){ ?> | |
18 | + <tr> | |
19 | + <?php for($i = 1; $i <= 10; $i++){?> | |
20 | + <td><?php echo $i . "열" ?></td> | |
21 | + <?php } ?> | |
22 | + </tr> | |
23 | + <?php } ?> | |
24 | + </table> | |
25 | + </div> | |
26 | +</body> | |
27 | +</html>(No newline at end of file) |
Add a comment
Delete comment
Once you delete this comment, you won't be able to recover it. Are you sure you want to delete this comment?