게시글 가로로 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를 추가 생성하여 처리하면 될듯 합니다.
!-->