for문 코드 오류
관련링크
본문
현재 이렇게 나옵니다. 저기 파란 부분은 이미지가 들어갈 곳으로 내용 맨 왼쪽에 들어가야하는데 위에서 내려가질 않고, 사진 2개가 맨 위에 붙어서 반복되는 중입니다 테두리는 집합장소 밑에서 끝나야되는데 테두리가 생기지 않고 맨 밑에만 생깁니다.
코드를 올릴테니 어떤 코드를 어디로 옮겨야하는지 봐주실 수 있을까요?
<script src="<?php echo $board_skin_url; ?>/script.js"></script>
<link rel="stylesheet" href="<?php echo $board_skin_url; ?>/style.css">
<form id="list" name="fboardlist" method="post">
<p>
<input type="hidden" name="bo_table" value="<?php echo $bo_table; ?>">
<input type="hidden" name="page" value="<?php echo $page; ?>">
<input type="hidden" name="sw" value="">
</p>
<?php for($i = 0; $i < count($list); $i++){ ?>
<div class="utu clearfix">
<div class="yty_img"><img src="" alt=""></div>
<table class="mara_list" id="mara_list2">
<!--style="width: <?php echo $width; ?>;"-->
<caption class="hidden">상품정보 리스트</caption>
<colgroup>
<!--<col class="rm_grid_1">
<col class="rm_grid_1">
<col class="rm_grid_4">
<col class="rm_grid_3">
<col class="rm_grid_3">
<col class="rm_grid_3">
<col class="rm_grid_3">
<col class="rm_grid_2">-->
</colgroup>
<thead>
<tr>
<!--<th scope="col">
<label for="chkall" class="sound_only">게시물 전체</label>
<input type="checkbox" id="chkall" onclick="if(this.checked) all_checked(true);else all_checked(false);"></th>-->
<!--<th scope="col">번호</th>-->
<th colspan="3" scope="col" class="rm_grid_15 frm_info5">
<strong class="tPoint frm_info">
<a href="<?php echo $list[$i]['href']; ?>"><?php if($is_category && $list[$i]['ca_name']){ echo $list[$i]['ca_name'] . '/'; } ?><!--<?php echo $list[$i]['wr_1']; ?>--> <?php echo $list[$i]['subject']; ?></a>
</strong>
<!--<span>기간 : <?php echo $list[$i]['wr_1']; ?>일<br>출발요일 : <?php echo $list[$i]['wr_2']; ?>요일<br>교통수단 : <?php echo $list[$i]['wr_3']; ?></span>-->
</th>
<td align="right" class="frm_info2 rm_grid_2">
¥ <?php echo($list[$i]['wr_1']); ?>
</td><td></td>
<!--<th scope="col"><span class="frm_info">불포함사항</span></th>
<th scope="col">비고</th>-->
</tr>
<tr>
<th scope="col" class="rm_grid_4 frm_info3"><img src="<?php echo $board_skin_url; ?>/img/시계.png" width="20px" height="20px" alt="소요시간"><span>소요시간</span></th>
<td align="left" class="rm_grid_4"><?php echo($list[$i]['wr_2']); ?></td><td class="rm_grid_8"> </td><td class="rm_grid_4"> </td>
</tr>
<tr>
<th scope="col" class="rm_grid_4 frm_info3"><img src="<?php echo $board_skin_url; ?>/img/사람.png" width="20px" height="20px" alt="최소출발인원"><span>최소출발인원</span></th>
<td align="left" class="rm_grid_4"><?php echo($list[$i]['wr_3']); ?></td><td class="rm_grid_8"> </td><td class="rm_grid_4"> </td>
</tr>
<tr>
<th scope="col" class="rm_grid_4 frm_info3"><img src="<?php echo $board_skin_url; ?>/img/위치.png" width="20px" height="20px" alt="집합장소"><span>집합장소</span></th>
<td align="left" class="rm_grid_4"><?php echo($list[$i]['wr_4']); ?></td><td class="rm_grid_8"> </td><td class="rm_grid_4"> </td>
</tr>
</thead>
<tbody>
<tr>
<!--<td>
<label for="chk_wr_id_<?php echo $i ?>" class="sound_only"><?php echo $list[$i]['subject'] ?></label>
<input type="checkbox" name="chk_wr_id[]" value="<?php echo $list[$i]['wr_id'] ?>" id="chk_wr_id_<?php echo $i ?>">
</td>-->
<!--<td><?php echo $list[$i]['wr_id']; ?></td>-->
<!--<td><?php echo($list[$i]['wr_7']); ?></td>
<td><?php echo($list[$i]['wr_8']); ?></td>-->
</tr>
<?php } // for 끝
if ($i == 0) {
if($is_checkbox) $colspan = 8;
else $colspan = 7;
echo '<tr><td colspan="'.$colspan.'" class="empty_table">예약 내역이 없습니다.</td></tr>';
}
?>
</tbody>
</table>
</div><!--utu-->
<div class="mara_btn_area">
<a href="<?php echo $write_href; ?>"><img src="<?php echo $board_skin_url; ?>/img/b_write.gif" alt="등록하기"></a>
<a href="#none" onclick="select_delete();"><img src="<?php echo $board_skin_url; ?>/img/b_delete.gif" alt="삭제하기"></a><!-- 인풋이나 버튼으로 처리 -->
<a href="#none" onclick="select_copy('copy');"><img src="<?php echo $board_skin_url; ?>/img/b_copy.gif" alt="복사하기"></a>
<a href="#none" onclick="select_copy('move');"><img src="<?php echo $board_skin_url; ?>/img/b_move.gif" alt="이동하기"></a>
</div>
</form>
!-->
답변 2
<div class="utu clearfix"> <div class="yty_img"><img src="" alt=""></div> <table class="mara_list" id="mara_list2"> <!--style="width: <?php echo $width; ?>;"--> <caption class="hidden">상품정보 리스트</caption> <colgroup> <col class="rm_grid_1"> <col class="rm_grid_1"> <col class="rm_grid_4"> <col class="rm_grid_3"> <col class="rm_grid_3"> <col class="rm_grid_3"> <col class="rm_grid_3"> <col class="rm_grid_2"> </colgroup> <thead>
<?php for($i = 0; $i < count($list); $i++){ ?>
<tr>
..........
이렇게 한번 해보셔서 표시되는 내용을 보시고 수정해 보세요
utu clearfix 이 클래스를 가진 얘들이 계속 for문을 돌아야하는데 그렇지않고 다시 clearfix div안에서 한번 더 돌아가네요 .. 일단 php자체가 html구조가 끊어져서 들어가니 tail.php 부분들도 한번 보시면서 구조가 for문 돌아가는곳이 list.skin.php말고 다른 돌아가는곳에도 구조가 깨지는곳이 있는지 한번 확인해보세요
답변을 작성하시기 전에 로그인 해주세요.