php for문 예제
- <!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=utf-8">
- <title>title</title>
- <style type="text/css">
- html,body {width:800px; margin:0 auto; padding:0;}
- li {float:left; position:relative; width:380px; padding:0 0 10px 0; list-style:none;}
- li p {position:absolute; top:00px; right:40px; font-size:100px; text-align:right; font-style:italic; font-family:arial;}
- li img {width:365px; border:4px solid #aaa;}
- ul {margin:0 auto; padding:0; width:800px;}
- </style>
- <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"></script>
- <script type="text/javascript">
- $(document).ready(
- function() {
- $("li:nth-child(8n+1)").css("page-break-before", "always"); //8의 배수 + 1 번째 아이템을 반환, 다음페이지에 인쇄
- });
- </script>
- </head>
- <body>
- <ul>
- <?php
- for($index=1; $index<=500; $index=$index+1) { // "+1" 한줄에 보여지는 갯수
- }
- ?>
- </ul>
- </body>
- </html>
- ==========================================================================
- <!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=utf-8">
- <title>title</title>
- <style type="text/css">
- html,body {width:800px; margin:0 auto; padding:0;}
- li {float:left; position:relative; width:100px; padding:0 0 10px 0; list-style:none;}
- li p {position:absolute; top:00px; right:40px; font-size:100px; text-align:right; font-style:italic; font-family:arial;}
- li img {}
- ul {margin:0 auto; padding:0; width:800px;}
- </style>
- <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"></script>
- <script type="text/javascript">
- /*
- $(document).ready(
- function() {
- $("li:nth-child(8n+1)").css("page-break-before", "always"); //8의 배수 + 1 번째 아이템을 반환, 다음페이지에 인쇄
- });
- */
- </script>
- </head>
- <body>
- <ul>
- <?php
- for($index=2001; $index<=2500; $index=$index+1) { // "+1" 한줄에 보여지는 갯수
- echo "<li><img src='http://htmltutor.co.kr/new/zero/icon/private_name/" . sprintf('%01d', $index) . ".gif' /></li>"; //" . sprintf('%03d', $index) . "
- }
- ?>
- </ul>
- </body>
- </html>
- 밖에
- <?for($index=1; $index<=9; $index=$index+1) { ?>
- 내용
- <? } ?>
- <?for($index=1; $index<=10; $index=$index+1) { ?>
- <a href="#pageNum"><?=$index?></a>
- <? } ?>
- <?for($i=1; $i<=10; $i++){ ?>
- <a href="#pageNum"><?=$i;?></a>
- <? } ?>
php for문 예제
Reviewed by jieun
on
오전 9:15
Rating:
댓글 없음: