10월 22일 서버 점검 안내 (00:00~06:00)
다

최신글 갤러리 도움좀 부탁드립니다.

최신글 갤러리를 만들었는데요.
ㅁㅁㅁ <- 이렇게 가로로 3개가 출력되는것을

ㅁㅁㅁ
ㅁㅁㅁ <- 이렇게 가로로 3개를 2단으로 출력하고 싶습니다.

고수분들의 가르침 부탁드립니다.


소스

<table width="499" cellspacing="0" cellpadding="0" bgcolor="#323232" border="0">
<tr>
<?
for ($i=0; $i<count($list); $i++)
{
$list[$i]['content']=eregi_replace(" "," ",$list[$i]['content']);

if($list[$i][file][0][file])
{
$file = "<img src='".$list[$i][file][0][path] .'/'. $list[$i][file][0][file]."' width=\"157\" height=\"130\" border=\"0\" align=\"center\">";
}
else
{
$file="";
}
?>
<td width="163" height="185" valign="top">
<table width="163" height="185" cellspacing="0" cellpadding="0" style="background:url(<?=$g4['path']?>/images/box_bg.png); background-repeat:no-repeat"">
<tr>
<td width="163" height="1" colspan="2"></td>
</tr>
<tr>
<td width="2" height="130"></td>
<td width="157" height="130">
<table width="157" height="130">
<tr>
<td colspan='2'>
<a href="<?=$list[$i]['href']?>"><?=$file?></a>
</td>
<td width="2" height="130"></td>
</tr>
<tr>
<td width="163" height="1" colspan="3"></td>
</tr>
<tr>
<td width="2" height="50"></td>
<td width="157" height="50"></td>
<td width="2" height="50"></td>
</tr>
</table>
</td>
</tr>
</table>
</td>
<?
}
?>
<? if(!count($list))
{
?>
<td align=center height=30><font color=#6A6A6A>게시물이 없습니다.</a></td>
<?
}
?>
</tr>
</table>
|

댓글 2개

for문 아래 ?> 바로 위에 넣어보세요
if($i && $i % 3==0) echo "</tr><tr>";
아.. 이렇게 간단한것을.. 감사합니다~
댓글을 작성하시려면 로그인이 필요합니다.

그누보드4 관련 질문은 QA 로 이전됩니다. QA 그누보드4 바로가기 기존 게시물은 열람만 가능합니다.

+
제목 글쓴이 날짜 조회
12-01-31 조회 880
12-01-31 조회 898
12-01-31 조회 907
12-01-31 조회 1,102
12-01-30 조회 1,262
12-01-30 조회 1,361
12-01-30 조회 1,656
12-01-30 조회 1,055
12-01-30 조회 897
12-01-30 조회 1,080
12-01-30 조회 1,130
12-01-30 조회 1,271
12-01-30 조회 929
12-01-30 조회 1,262
12-01-30 조회 922
12-01-30 조회 1,102
12-01-30 조회 1,027
12-01-30 조회 1,678
12-01-30 조회 1,651
12-01-30 조회 1,474