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

· 2012-01-30 (월) 18:58:45 · 917 · 2
최신글 갤러리를 만들었는데요.
ㅁㅁㅁ <- 이렇게 가로로 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>";
2012-01-31 (화) 11:37:03
아.. 이렇게 간단한것을.. 감사합니다~
댓글을 작성하시려면 로그인이 필요합니다.

그누4 질문답변

66,531건

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

+
제목 글쓴이 날짜 조회
12-01-31 조회 867
12-01-31 조회 883
12-01-31 조회 896
12-01-31 조회 1,086
12-01-30 조회 1,251
12-01-30 조회 1,350
12-01-30 조회 1,642
12-01-30 조회 1,044
12-01-30 조회 883
12-01-30 조회 1,066
12-01-30 조회 1,122
12-01-30 조회 1,259
12-01-30 조회 918
12-01-30 조회 1,254
12-01-30 조회 911
12-01-30 조회 1,088
12-01-30 조회 1,010
12-01-30 조회 1,661
12-01-30 조회 1,635
12-01-30 조회 1,461