그누 질문은 아닌데요.. 테이블 안에 td 자동 넘기기.. > 그누4 질문답변

그누4 질문답변

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

그누 질문은 아닌데요.. 테이블 안에 td 자동 넘기기.. 정보

그누 질문은 아닌데요.. 테이블 안에 td 자동 넘기기..

본문

쇼핑몰 제작중에 있습니다..

 테이블 안에..

 <table width="620"><tr>


 // 다음 소스가 루팅 됩니다..

 <td width="25%">{{name}}</td>

 // 루팅 끝..

 </tr></table>


 로 루팅 되는데요....

 cafe24 쇼핑몰이구요..

 <td>안에 있는 내용이 개수만큼 루팅되는건데..


 a물품 b물품 c물품 d물품
 e물품 f물품 g물품 h물품

 이렇게 루팅되게 하려면 어떻게 해야 하나요?

 현제는..

 a물품 b물품 c물품 d물품 e물품 f물품 g물품 h물품

 이렇게 움직이네요ㅠ(폭은 점점 줄어 들구요..)


 다음은 원본 소스입니다..ㅠ


//////

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
</head>

<body>
<table width="800">
  <tr>
      <td height="6" colspan="4" background="/web/upload/cate_list_bg1.gif"></td>
  </tr>
  <tr>
      <td colspan="4" height=30 background="/web/upload/cate_list_bg.gif">
            <table width="99%" align=center border="0" cellspacing="2" cellpadding="5" >



  <tr>
      <td width="110" align="center" class="part01" STYLE="color:#669900;font-size:{{$font_array.c_3.font_size}};font-family:{{$font_array.c_3.font_type}};">
      {{$cate_name}} </td>
      <td width="680" STYLE="color:{{$font_array.c_3.font_color}};font-size:{{$font_array.c_3.font_size}};font-family:{{$font_array.c_3.font_type}};"><table width=100% border="0" cellspacing="0" cellpadding="0"><tr>

















// 루팅되는 부분..


<td width=162style="word-break:break-all"> &nbsp; <a href="category.php?cate_no={{$no2}}"><font STYLE="color:{{$font_array.c_3.font_color}};font-size:{{$font_array.c_3.font_size}};font-family:{{$font_array.c_3.font_type}};">{{$name}}</font></a> &nbsp; <font STYLE="color:#cccccc">|</font></td>
<td width=162style="word-break:break-all"> &nbsp; <a href="category.php?cate_no={{$no2}}"><font STYLE="color:{{$font_array.c_3.font_color}};font-size:{{$font_array.c_3.font_size}};font-family:{{$font_array.c_3.font_type}};">{{$name}}</font></a> &nbsp; <font STYLE="color:#cccccc">|</font></td>
<td width=162style="word-break:break-all"> &nbsp; <a href="category.php?cate_no={{$no2}}"><font STYLE="color:{{$font_array.c_3.font_color}};font-size:{{$font_array.c_3.font_size}};font-family:{{$font_array.c_3.font_type}};">{{$name}}</font></a> &nbsp; <font STYLE="color:#cccccc">|</font></td>
<td width=162style="word-break:break-all"> &nbsp; <a href="category.php?cate_no={{$no2}}"><font STYLE="color:{{$font_array.c_3.font_color}};font-size:{{$font_array.c_3.font_size}};font-family:{{$font_array.c_3.font_type}};">{{$name}}</font></a> &nbsp; <font STYLE="color:#cccccc">|</font></td>
<td width=162style="word-break:break-all"> &nbsp; <a href="category.php?cate_no={{$no2}}"><font STYLE="color:{{$font_array.c_3.font_color}};font-size:{{$font_array.c_3.font_size}};font-family:{{$font_array.c_3.font_type}};">{{$name}}</font></a> &nbsp; <font STYLE="color:#cccccc">|</font></td>


// 루팅 끝..







</tr></table>

</td>
  </tr>



























            </table>
      </td>
  </tr>
  <tr>
      <td height="6" colspan="4" background="/web/upload/cate_list_bg2.gif"></td>
  </tr>
  <tr>
      <td height="10" colspan="4"></td>
  </tr> 
  </table>
</body>
</html>
  • 복사

댓글 전체

해당 부분을 if문으로 감쌀수 있다면. table 로 가능할듯 보이지만 제가 그 방법을 모르니 아래와 같은 방식으로 해보시기 바랍니다.

<ul style="width:100%">
    <li style="float:left;"></li>
    <li style="float:left;">1</li>
    <li style="float:left;">2</li>
    <li style="float:left;">3</li>
    <li style="float:left;">4</li>
    <li style="float:left;">5</li>
    <li style="float:left;">6</li>
    <li style="float:left;">7</li>
    <li style="float:left;">8</li>
    <li style="float:left;">9</li>
</ul>

각 li에 원하는 width를 대입하면 상위 레이어에 도달할경우 아래로 내려갑니다.
<ul style="width:800px">
    <li style="float:left; width:200px;">0</li>
    <li style="float:left; width:200px;">0</li>
    <li style="float:left; width:200px;">0</li>
    <li style="float:left; width:200px;">0</li>
    <li style="float:left; width:200px;">0</li>
    <li style="float:left; width:200px;">0</li>
    <li style="float:left; width:200px;">0</li>
    <li style="float:left; width:200px;">0</li>
    <li style="float:left; width:200px;">0</li>
    <li style="float:left; width:200px;">0</li>
</ul>
머 포인트가 있건 없건 신경않쓰지만.

아이피보면 다 나옵니다. 아이디를 두개 사용하시는군요

기껏 소스 분석하고 해결 방법 알려드렸더니.

에효 질답에서 활동좀 하려고 했는데 그만 둬야겠네요.
이 부분은 관리자에서 제어 할 수 있는 부분을 소스로 고치시는건가요?
추가 코드라면 모르겠으나 처음부터 소스코딩 들어가고 계신거라면 관리자 기능을 좀더 살펴보시기 바랍니다.
기본적으로 루팅 되던 것을 수정하고 계신거라면 분명히 그에 관한 변경 기능이 있을껍니다.
너무 복잡하긴 해도 관리자가... 디자인 적인 기능은 기본적인건 넣어 놨답니다.

코드는 위에분들이 잘 제시 하셨네요.

<ul style="width:800px">
    <li style="float:left; width:200px;">0</li>
    <li style="float:left; width:200px;">0</li>
    <li style="float:left; width:200px;">0</li>
    <li style="float:left; width:200px;">0</li>
    <li style="float:left; width:200px;">0</li>
    <li style="float:left; width:200px;">0</li>
    <li style="float:left; width:200px;">0</li>
    <li style="float:left; width:200px;">0</li>
    <li style="float:left; width:200px;">0</li>
    <li style="float:left; width:200px;">0</li>
</ul>
이게 정답입니다.
ul너비가 800이고 200짜리가 8개라면 자동으로 800이상일때 줄바꿈 됩니다.
다만... 보더값등이 들어갔을땐 1px씩 조정하셔서 마추셔야합니다.
© SIRSOFT
현재 페이지 제일 처음으로