두 줄로 출력하려면 어떻게 해야하죠? 정보
두 줄로 출력하려면 어떻게 해야하죠?본문
<table width='330' cellpadding='0' cellspacing='0' border='0'>
<? for ($i=0; $i<count($pc); $i++) { ?>
<tr class=ht>
<td>
<? include "$g4[path]/pack/$pc[$i]"; ?>
</td>
</tr>
<? } ?>
</table>
위처럼 include로 1줄씩 출력이 됩니다.
그런데... 가로로 2줄씩 출력이 되게 하려면 어떤 문구를 넣어야 하나요?
도저히 해봐도 오류가 발생하네요 .. 도움을 부탁드립니다.
댓글 전체
tr 을 for 문 밖으로 빼주시면 될꺼같은데 ...;;
제가 그걸 잘 못해서용 ㅠㅠ

<table width='330' cellpadding='0' cellspacing='0' border='0'>
<? for ($i=0; $i<count($pc); $i++) { ?>
<tr class=ht>
<td>
<? include "$g4[path]/pack/$pc[$i]"; ?>
</td>
</tr><tr class=ht>
<td>
<? include "$g4[path]/pack/$pc[$i+1]"; ?>
</td>
</tr>
<? $i = $i + 1; } ?>
</table>
<? for ($i=0; $i<count($pc); $i++) { ?>
<tr class=ht>
<td>
<? include "$g4[path]/pack/$pc[$i]"; ?>
</td>
</tr><tr class=ht>
<td>
<? include "$g4[path]/pack/$pc[$i+1]"; ?>
</td>
</tr>
<? $i = $i + 1; } ?>
</table>
안되네요 ㅜ
Parse error: syntax error, unexpected T_ENCAPSED_AND_WHITESPACE, expecting ']' in
<? include "$g4[path]/pack/$pc[$i+1]"; ?> <--- 이부부에 대한 에러가 발생하네요 ㅠㅠ
Parse error: syntax error, unexpected T_ENCAPSED_AND_WHITESPACE, expecting ']' in
<? include "$g4[path]/pack/$pc[$i+1]"; ?> <--- 이부부에 대한 에러가 발생하네요 ㅠㅠ

<table width=330 cellpadding=0 cellspacing=0 border=0>
<tr>
<?
for ($i=0; $i<count($pc); $i++) {
if ($i && $i%2==0)
echo "</tr><tr class=ht>";
echo "<td>";
include "$g4[path]/pack/$pc[$i]";
echo "</td>";
}
// 나머지 td
$cnt = $i%2;
if ($cnt)
for ($i=$cnt; $i<2; $i++)
echo "<td> </td>";
?>
</tr>
</table>
<tr>
<?
for ($i=0; $i<count($pc); $i++) {
if ($i && $i%2==0)
echo "</tr><tr class=ht>";
echo "<td>";
include "$g4[path]/pack/$pc[$i]";
echo "</td>";
}
// 나머지 td
$cnt = $i%2;
if ($cnt)
for ($i=$cnt; $i<2; $i++)
echo "<td> </td>";
?>
</tr>
</table>
Parse error: syntax error, unexpected T_VARIABLE, expecting ',' or ';' in
include "$g4[path]/pack/$pc[$i]"; <== 이거에 대한 오류가 발생하네요 ㅠㅠ
include "$g4[path]/pack/$pc[$i]"; <== 이거에 대한 오류가 발생하네요 ㅠㅠ

<table width=330 cellpadding=0 cellspacing=0 border=0>
<tr>
<?
for ($i=0; $i<count($pc); $i++) {
if ($i && $i%2==0)
echo "</tr><tr class=ht>";
echo "<td>";
include_once("$g4[path]/pack/$pc[$i]");
echo "</td>";
}
// 나머지 td
$cnt = $i%2;
if ($cnt)
for ($i=$cnt; $i<2; $i++)
echo "<td> </td>";
?>
</tr>
</table>
<tr>
<?
for ($i=0; $i<count($pc); $i++) {
if ($i && $i%2==0)
echo "</tr><tr class=ht>";
echo "<td>";
include_once("$g4[path]/pack/$pc[$i]");
echo "</td>";
}
// 나머지 td
$cnt = $i%2;
if ($cnt)
for ($i=$cnt; $i<2; $i++)
echo "<td> </td>";
?>
</tr>
</table>
감사합니다. ^^ 굿!! 곰순이푸님 감사요!!