게시글 가로로 2개씩 나오게 하려면...

게시글 가로로 2개씩 나오게 하려면...

QA

게시글 가로로 2개씩 나오게 하려면...

본문

안녕하세요,~~

아래의 소스를 보시면 한줄로 세로로 나열하게 되어있는데 아래 소스를 수정하여 가로 2개씩 나오게 하려는데 보시고 도움 부탁드립니다. 감사합니다.

 

<?php
//  최신글
$sql = "select a.*, b.* from g5_write_lawyer a, g5_board_file b where a.wr_id=b.wr_id and b.bo_table='lawyer'";
//echo $sql;
$result = sql_query($sql);

for ($i=$i+1; $row=sql_fetch_array($result); $i++) {

 
?> 


<table style="width:313px; background:url(/mobile/shop/img/lawyer_bg.png) no-repeat;">
<tr>
<td>
<table style="width:313px; ">
<tr>
<td><img src="/data/file/lawyer/<?php echo $row["bf_file"] ?>" width="60" height="79"></td>
 <td> <?php echo $row["wr_subject"] ?></td>
 </tr>
   </table>
<div style="margin-left:70px; top:-20%;">
<table style="width:240px;" >

   <tr><td style="width:240px;"  ><?php echo substr($row["wr_content"],0,80)?></td>
  </tr>
  </table>
  </div>
  </td>
  </tr>
  </table>
 
 

<?php
  
}
?> 

 

 

이 질문에 댓글 쓰기 :

답변 2


<table width="100%">
<tr>
<td>
<table style="width:313px; background:url(/mobile/shop/img/lawyer_bg.png) no-repeat;">
<tr>
<td>
<table style="width:313px; ">
<tr>
<td><img src="/data/file/lawyer/<?php echo $row["bf_file"] ?>" width="60" height="79"></td>
<td> <?php echo $row["wr_subject"] ?></td>
</tr>
</table>
<div style="margin-left:70px; top:-20%;">
<table style="width:240px;" >
   <tr><td style="width:240px;"  ><?php echo substr($row["wr_content"],0,80)?></td>
</tr>
</table>
</div>
</td>
</tr>
</table>
</td>
<td>
<table style="width:313px; background:url(/mobile/shop/img/lawyer_bg.png) no-repeat;">
<tr>
<td>
<table style="width:313px; ">
<tr>
<td><img src="/data/file/lawyer/<?php echo $row["bf_file"] ?>" width="60" height="79"></td>
<td> <?php echo $row["wr_subject"] ?></td>
</tr>
</table>
<div style="margin-left:70px; top:-20%;">
<table style="width:240px;" >
   <tr><td style="width:240px;"  ><?php echo substr($row["wr_content"],0,80)?></td>
</tr>
</table>
</div>
</td>
</tr>
</table>
</td>
</tr>
</table>

 

이런식으로 테이블 겹겹이 처리 되어지는 부분은 있지만 지금 형태로 본다면 다 감싸는 테이블에 tr td를 추가 생성하여 처리하면 될듯 합니다.

답변을 작성하시기 전에 로그인 해주세요.
전체 34
QA 내용 검색

회원로그인

(주)에스아이알소프트 / 대표:홍석명 / (06211) 서울특별시 강남구 역삼동 707-34 한신인터밸리24 서관 1404호 / E-Mail: admin@sir.kr
사업자등록번호: 217-81-36347 / 통신판매업신고번호:2014-서울강남-02098호 / 개인정보보호책임자:김민섭(minsup@sir.kr)
© SIRSOFT