목록에 한줄당 이미지수 조정 문의드립니다.

목록에 한줄당 이미지수 조정 문의드립니다.

QA

목록에 한줄당 이미지수 조정 문의드립니다.

본문

안녕하세요.

스킨을 받아서 사용중인데요..

현재 한줄당 2개씩 나오는데 한줄에 3개의 작은 이미지가 나오게 하려면 어떻게 해야할지요..??

이래저래 해봐도 답이 안나와서 도움을 요청드려봅니다..

 

05d0f5ee5cce6889339275008e8e6349_1411967236_1132.jpg
05d0f5ee5cce6889339275008e8e6349_1411967239_3836.jpg 

<table cellpadding="2" cellspacing="2" border=1 bordercolor="#E1E1E2">
       </table>
                        <!-- 목록 -->
                        <? for ($i=0; $i<count($list); $i++) {
         echo "<td height='50' align='center' valign='top'>";
          if(!$member[mb_id]) {
           
          }

          $list_file = sql_fetch("select bf_file from $g4[board_file_table] where bo_table='$bo_table' and bf_no = '0' and wr_id='{$list[$i][wr_id]}'");
          if($list_file[bf_file]) {
           $list_file_view[$i] = "<a href='{$list[$i][href]}' onfocus='this.blur()'><img src='./../data/file/$bo_table/$list_file[bf_file]' style='cursor:pointer' border=0 width=$small_width height=$small_height onmouseover=\"document.getElementById('large').src='./../data/file/$bo_table/$list_file[bf_file]'; document.getElementById('view').href='{$list[$i][href]}'\"></a>";
           $list_lfile_view[$i] = "<img id=large src='./../data/file/$bo_table/$list_file[bf_file]' border=0 width=$large_width height=$large_height>"; 
          }else {
           $list_file_view[$i] = "";
           $list_lfile_view[$i] = "";
          }

         $latest_subject = cut_str($list[$i][subject], 12, '...'); // 제목

         echo $list_file_view[$i];
         //echo "<br>";
         //echo $latest_subject;
         echo "</td>";
      
         if($i%2) {
          echo "</tr><tr>";
         }

        } ?>
                      </tr>
       </table>​ 

이 질문에 댓글 쓰기 :

답변 5

if($i%2) { 

3으로..​

저도 그건 해봤는데 안되더라구요.. 2를 3으로 하면 아래처럼 나오네요..

05d0f5ee5cce6889339275008e8e6349_1411969359_9699.jpg
 

코드가 먼가 이상해보여서 확인이 안되는데 작은 이미지들어가는곳 가로 사이즈를 늘려보세요.
<table cellpadding="2" cellspacing="2" border=1 bordercolor="#E1E1E2">
여기가 맞으면 여기에 width값 주시던지 더 윗단에 있으면 거기서 하시고..

전체 소스입니다.

그리고 하나더 질문드립니다. 왼쪽의 작은 이미지와 오른쪽 큰이미지의 위치를 바꾸려하는데 셀만 바꿔서는 안되는데 어떻게 고쳐야 할지요..?

 

 

<? 

//작은 이미지 사이즈
$small_width = "64";
$small_height = "46";
//큰이미지
$large_width = "500";
$large_height = "340";

// 선택옵션으로 인해 셀합치기가 가변적으로 변함
$colspan = 7;

// 제목이 두줄로 표시되는 경우 이 코드를 사용해 보세요.
// <nobr style='display:block; overflow:hidden; width:000px;'>제목</nobr>
?>
<!-- 게시판 목록 시작 -->
<table width="740">
<tr height="25">
    <td width="50%">
        <form name="fcategory" method="get" style="margin:0;">
        <? if ($is_category) { ?>
            <select name=sca onchange="location='<?=$category_location?>'+this.value;">
            <option value=''>select</option>
            <?=$category_option?>
            </select>
        <? } ?>
        <? if ($mw_basic[cf_type] == "gall" && $is_checkbox) { ?><input onclick="if (this.checked) all_checked(true); else all_checked(false);" type=checkbox><?}?>
        </form>    </td>
    <td align="right"><? if ($admin_href) { ?><a href="<?=$admin_href?>"><img src="<?=$board_skin_path?>/img/btn_admin.gif" title="관리자" width="63" height="22" border="0" align="absmiddle"></a><?}?>    </td>
</tr>
<tr><td height=5></td></tr>
</table>

<table width="740" cellpadding=0 cellspacing=0>
 <tr> 
  <td><? if (count($list) == 0) { echo "<td colspan='$colspan' valign-top height=50 align=center>게시물이 없습니다.</td>"; } ?>
 </tr>
</table>

  <table width="100%" cellpadding="0" cellspacing="0">
    <tr>   
     <td width="24%" valign="top">
     
     <table cellpadding="2" cellspacing="2" border=1 bordercolor="#E1E1E2">
                      <tr>
                        <!-- 목록 -->
                        <? for ($i=0; $i<count($list); $i++) {
         echo "<td height='50' align='center' valign='top'>";
          if(!$member[mb_id]) {
           
          }

          $list_file = sql_fetch("select bf_file from $g4[board_file_table] where bo_table='$bo_table' and bf_no = '0' and wr_id='{$list[$i][wr_id]}'");
          if($list_file[bf_file]) {
           $list_file_view[$i] = "<a href='{$list[$i][href]}' onfocus='this.blur()'><img src='./../data/file/$bo_table/$list_file[bf_file]' style='cursor:pointer' border=0 width=$small_width height=$small_height onmouseover=\"document.getElementById('large').src='./../data/file/$bo_table/$list_file[bf_file]'; document.getElementById('view').href='{$list[$i][href]}'\"></a>";
           $list_lfile_view[$i] = "<img id=large src='./../data/file/$bo_table/$list_file[bf_file]' border=0 width=$large_width height=$large_height>"; 
          }else {
           $list_file_view[$i] = "";
           $list_lfile_view[$i] = "";
          }

         $latest_subject = cut_str($list[$i][subject], 12, '...'); // 제목

         echo $list_file_view[$i];
         //echo "<br>";
         //echo $latest_subject;
         echo "</td>";
      
         if($i%2) {
          echo "</tr><tr>";
         }

        } ?>
                      </tr>
       </table>
  </td><td valign="top">
 
  <table width="100%" cellpadding="0" valign="top" cellspacing="0">   
    <tr>
      <td valign="top"><table cellpadding="0" cellspacing="0" border="0" bordercolor="#E1E1E2">
          <tr>
     <td width="5"></td>
            <td><?=$list_lfile_view[0]?></td>
          </tr>
        </table></td>
    </tr>
  </table>
 
  </td></tr>
  <tr><td>
 
  <!-- 페이지 -->
  <table width="100%" cellspacing="0" cellpadding="0">
    <tr>
      <td width="100%" align="center" height=30><? if ($prev_part_href) { echo "<a href='$prev_part_href'><img src='$board_skin_path/img/btn_search_prev.gif' border=0 align=absmiddle title='이전검색'></a>"; }
       
        // 기본으로 넘어오는 페이지를 아래와 같이 변환하여 이미지로도 출력할 수 있습니다.
        echo $write_pages;
        $write_pages = str_replace("처음", "<img src='$board_skin_path/img/begin.gif' border='0' align='absmiddle' title='처음'>", $write_pages);
        $write_pages = str_replace("이전", "<img src='$board_skin_path/img/prev.gif' border='0' align='absmiddle' title='이전'>", $write_pages);
        $write_pages = str_replace("다음", "<img src='$board_skin_path/img/next.gif' border='0' align='absmiddle' title='다음'>", $write_pages);
        $write_pages = str_replace("맨끝", "<img src='$board_skin_path/img/end.gif' border='0' align='absmiddle' title='맨끝'>", $write_pages);
        $write_pages = preg_replace("/<span>([0-9]*)<\/span>/", "<b><font style=\"font-family:돋움; font-size:9pt; color:#797979\">$1</font></b>", $write_pages);
        $write_pages = preg_replace("/<b>([0-9]*)<\/b>/", "<b><font style=\"font-family:돋움; font-size:9pt; color:orange;\">$1</font></b>", $write_pages);
  if ($next_part_href) { echo "<a href='$next_part_href'><img src='$board_skin_path/img/btn_search_next.gif' border=0 align=absmiddle title='다음검색'></a>"; } ?>
      </td>
    </tr>
  </table>
 
  </td></tr>
</table>
   
   
  <!-- 버튼 링크 -->
  <form name=fsearch method=get style="margin:0px;">
    <input type=hidden name=bo_table value="<?=$bo_table?>">
    <input type=hidden name=sca      value="<?=$sca?>">
    <table width=100%>
<tr>
    <td height="40"><? if ($list_href) { ?>
      <a href="<?=$list_href?>"><img src="<?=$board_skin_path?>/img/btn_list.gif" border="0"></a><? } ?>
        <? if ($write_href) { ?><a href="<?=$write_href?>"><img src="<?=$board_skin_path?>/img/btn_write.gif" border="0"></a><? } ?>
        <? if ($is_checkbox) { ?>
            <a href="javascript:select_delete();"><img src="<?=$board_skin_path?>/img/btn_select_delete.gif" border="0"></a>
            <a href="javascript:select_copy('copy');"><img src="<?=$board_skin_path?>/img/btn_select_copy.gif" border="0"></a>
            <a href="javascript:select_copy('move');"><img src="<?=$board_skin_path?>/img/btn_select_move.gif" border="0"></a>
            <a href="javascript:mw_move_cate();"><img src="<?=$board_skin_path?>/img/btn_select_cate.gif" border="0"></a>
        <? } ?>    </td>
    <td align="right">
        </td>
</tr>
</table>
  </form>
  </td>
 
  </tr>
 
</table>
​ 

일단 사이즈 맞추는거는 처음에 말한부분 3으로 바꾼 후
<td width="24%" valign="top"> 여기 %수치를 올리시거나
<td width="250" valign="top"> 이런 식으로 해서 공간을 늘려보세요.

답변을 작성하시기 전에 로그인 해주세요.
전체 1,010
QA 내용 검색

회원로그인

(주)에스아이알소프트 / 대표:홍석명 / (06211) 서울특별시 강남구 역삼동 707-34 한신인터밸리24 서관 1404호 / E-Mail: admin@sir.kr
사업자등록번호: 217-81-36347 / 통신판매업신고번호:2014-서울강남-02098호 / 개인정보보호책임자:김민섭(minsup@sir.kr)
© SIRSOFT