<!DOCTYPE html>

<html lang="ko">

<head>

<meta charset="utf-8"/>

<title>제목</title>


</head>

<body>

<table border="1" width="350" height="50">

<?

$loop = 0;

$cnt=1;

$x = 1;

$y = 1;

while ( $loop < 50 ) {

$a[$y][$x]=$cnt++;

$x++;

$y--;

$loop++;


if( $y < 0 && $x > 6 ){

echo "if both ";

echo "x y ".$x." , ".$y."<br>";

$x = 0;

$y = 0;

} elseif($y < 0){

$y = 6;

} elseif($x > 6){

$x = 0; $y++;

}

}

for($y=0; $y<=6; $y++){

echo "<tr height=40> ";

for($x=0;$x<7;$x++){

echo "<td width=40 align=center>";

if($a[$y][$x] != 0){

echo $a[$y][$x];

}else {

echo "&nbsp;";

}

echo"</td>";

}

echo "</tr>";

}

?>

</table>


<script type="text/javascript">

</script>

</body>

</html>




'이전것 > 개발' 카테고리의 다른 글

android -> Event  (0) 2016.07.07
https://play-entry.org/tt#!/basic/solve  (0) 2016.07.06
php -> two-dimensional arrays  (0) 2016.07.06
php -> make table, array, triangle  (0) 2016.07.05
HTML5 (3) 로그인 폼  (0) 2016.07.05
블로그 이미지

잉비니

,