1.2.3.4으로 나오는 부분은 1줄이 아닌 2줄로 코딩 하려 하는데 제가 잘 몰라서 어떻데 손을 데야 하나요?알려주시면 감사합니다.
댓글 1개
shop/faq.php 를 아래와 같이 수정해 보시기 바랍니다.
$sql = " select * from $g4[yc4_faq_table]
where fm_id = '$fm_id'
order by fa_order , fa_id ";
$result = sql_query($sql);
$str = "";
$list_mod = 2;
$td_width = (int)(100 / $list_mod);
for ($i=1; $row=sql_fetch_array($result); $i++)
{
/*
echo "<tr>";
echo "<td width=20 align=right valign=top>$i.</td>";
echo "<td valign=top><a href='#faq_{$fm_id}_{$i}' class=faq>" . stripslashes($row[fa_subject]) . "</a></td>";
echo "</tr>\n";
*/
if (($i-1) > 0 && (($i-1) % $list_mod == 0)) {
echo "</tr>\n\n<tr>\n";
}
echo "<td width='{$td_width}%' align=center valign=top>";
echo "<table width='100%'><tr>";
echo "<td width=20 align=right valign=top>$i.</td>";
echo "<td valign=top><a href='#faq_{$fm_id}_{$i}' class=faq>" . stripslashes($row[fa_subject]) . "</a></td>";
echo "</tr>";
echo "</table>";
$str .= "<a name='faq_{$fm_id}_{$i}'><br></a><table cellpadding=2 cellspacing=1 width=100%>";
$str .= "<tr>";
$str .= "<td width=38 valign=top align=right><img src='$g4[shop_img_path]/icon_poll_q.gif'></td>";
$str .= "<td class=point valign=top>" . stripslashes($row[fa_subject]) . "</td>";
$str .= "</tr>";
$str .= "<tr>";
$str .= "<td valign=top align=right><img src='$g4[shop_img_path]/icon_answer.gif'></td>";
$str .= "<td class=leading valign=top>" . stripslashes($row[fa_content]) . "</td>";
$str .= "</tr>";
$str .= "<tr>";
$str .= "<td colspan=2 align=right><a href='#g4_head'><img src='$g4[shop_img_path]/icon_top.gif' border=0></a></td>";
$str .= "</tr>";
$str .= "</table>";
}
// 나머지 td 를 채운다.
if (($cnt = $i%$list_mod) != 0) {
for ($k=$cnt; $k<$list_mod; $k++) {
echo "<td> </td>\n";
}
}
echo "</tr>\n";
echo "</table></td></tr></table>\n";
$sql = " select * from $g4[yc4_faq_table]
where fm_id = '$fm_id'
order by fa_order , fa_id ";
$result = sql_query($sql);
$str = "";
$list_mod = 2;
$td_width = (int)(100 / $list_mod);
for ($i=1; $row=sql_fetch_array($result); $i++)
{
/*
echo "<tr>";
echo "<td width=20 align=right valign=top>$i.</td>";
echo "<td valign=top><a href='#faq_{$fm_id}_{$i}' class=faq>" . stripslashes($row[fa_subject]) . "</a></td>";
echo "</tr>\n";
*/
if (($i-1) > 0 && (($i-1) % $list_mod == 0)) {
echo "</tr>\n\n<tr>\n";
}
echo "<td width='{$td_width}%' align=center valign=top>";
echo "<table width='100%'><tr>";
echo "<td width=20 align=right valign=top>$i.</td>";
echo "<td valign=top><a href='#faq_{$fm_id}_{$i}' class=faq>" . stripslashes($row[fa_subject]) . "</a></td>";
echo "</tr>";
echo "</table>";
$str .= "<a name='faq_{$fm_id}_{$i}'><br></a><table cellpadding=2 cellspacing=1 width=100%>";
$str .= "<tr>";
$str .= "<td width=38 valign=top align=right><img src='$g4[shop_img_path]/icon_poll_q.gif'></td>";
$str .= "<td class=point valign=top>" . stripslashes($row[fa_subject]) . "</td>";
$str .= "</tr>";
$str .= "<tr>";
$str .= "<td valign=top align=right><img src='$g4[shop_img_path]/icon_answer.gif'></td>";
$str .= "<td class=leading valign=top>" . stripslashes($row[fa_content]) . "</td>";
$str .= "</tr>";
$str .= "<tr>";
$str .= "<td colspan=2 align=right><a href='#g4_head'><img src='$g4[shop_img_path]/icon_top.gif' border=0></a></td>";
$str .= "</tr>";
$str .= "</table>";
}
// 나머지 td 를 채운다.
if (($cnt = $i%$list_mod) != 0) {
for ($k=$cnt; $k<$list_mod; $k++) {
echo "<td> </td>\n";
}
}
echo "</tr>\n";
echo "</table></td></tr></table>\n";
게시글 목록
| 번호 | 제목 |
|---|---|
| 56008 | |
| 56006 | |
| 55990 | |
| 55994 | |
| 55996 | |
| 55987 | |
| 55981 | |
| 55976 | |
| 55973 | |
| 55968 | |
| 55967 | |
| 55966 | |
| 55963 | |
| 55959 | |
| 55956 | |
| 55951 | |
| 55949 | |
| 55948 | |
| 55946 | |
| 55944 |
댓글 작성
댓글을 작성하시려면 로그인이 필요합니다.
로그인하기