묻고답하기
page_full_width">
최근글 2단 배열 다시 질문드립니다.
2012.12.14 02:20
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 | <!-- // 테이블형 출력 --> <!--@ else --> <table class = "widgetTableA" border= "1" cellspacing= "0" > <tbody> {@ $_idx =0} <!--@ foreach ( $widget_info ->content_items as $key => $item )--> <tr<!--@ if ( $_idx >= $widget_info ->list_count)--> style= "display:none" <!--@ end -->> <!--@ foreach ( $widget_info ->option_view_arr as $k => $v )--> <!--@ if ( $v == 'title' )--> <td class = "title" > <!--@ if ( $widget_info ->show_browser_title== 'Y' && $item ->getBrowserTitle())--> <a href= "<!--@if($item->contents_link)-->{$item->contents_link}<!--@else-->{getSiteUrl($item->domain, '', 'mid', $item->get('mid'))}<!--@end-->" ><strong class = "board" >{ $item ->getBrowserTitle()}</strong></a> <!--@ end --> <!--@ if ( $widget_info ->show_category== 'Y' && $item ->get( 'category_srl' ) )--> <a href= "{getSiteUrl($item->domain,'','mid',$item->get('mid'),'category',$item->get('category_srl'))}" ><strong class = "category" >{ $item ->getCategory()}</strong></a> <!--@ end --> <a href= "{$item->getLink()}" >{ $item ->getTitle( $widget_info ->subject_cut_size)}</a> <!--@ if ( $widget_info ->show_comment_count== 'Y' && $item ->getCommentCount())--> <em class = "replyNum" title= "Replies" ><a href= "{$item->getLink()}#comment" >{ $item ->getCommentCount()}</a></em> <!--@ end --> <!--@ if ( $widget_info ->show_trackback_count== 'Y' && $item ->getTrackbackCount())--> <em class = "trackbackNum" title= "Trackbacks" ><a href= "{$item->getLink()}#trackback" >{ $item ->getTrackbackCount()}</a></em> <!--@ end --> <!--@ if ( $widget_info ->show_icon== 'Y' )--> <span class = "icon" >{ $item ->printExtraImages()}</span> <!--@ end --> </td> <!--@ else if ( $v == 'nickname' )--> <td><a <!--@ if ( $item ->getMemberSrl())-->href= "#" onclick= "return false;" class = "author member_{$item->getMemberSrl()}" <!--@ elseif ( $item ->getAuthorSite())-->href= "{$item->getAuthorSite()}" onclick= "window.open(this.href); return false;" class = "author member" <!--@ else -->href= "#" onclick= "return false;" class = "author member" <!--@ end --> >{ $item ->getNickName()}</a></td> <!--@ else if ( $v == 'regdate' )--> <td class = "time" ><span class = "date" >{ $item ->getRegdate( "Y-m-d" )}</span> <span class = "hour" >{ $item ->getRegdate( "H:i" )}</span></td> <!--@ end --> <!--@ end --> </tr> {@ $_idx ++} <!--@ end --> </tbody> </table> |
위는 디폴트 컨텐츠 목록형이고
간단하게 만드니
<table>
<tbody>
{@$_idx=0}
<tr>
<td class="title">
<a href="">타이틀과 제목 자름</a>
<a href="">리플수</a>
<a href="">트랙백</a></em>
<span class="icon">아이콘출력</span>
</td>
<td>멤버이름 클릭시 오프너</td>
<td class="time">등록일</td>
</tr>
{@$_idx++}
</tbody>
</table>
이런 테이블 구조인데
2단 배열을 할려면
i>0 && i%2==0 이부분을
어디에다가 어떻게 삽입해야되는지요...
http://www.xpressengine.com/index.php?document_srl=20535838&search_keyword=2%EB%8B%A8&mid=qna
<tr>
</tr>
이 부분이 루프 안에 있습니다.
이걸
루프 밖으로 빼야 합니다.
그리고
루프시작 바로 다음줄에
<block cond="$_idx>0&&$_idx%2==0"></tr><tr></block>
이것 하나 추가하고
css 에서
테이블에 해당하는 클래스들 찾아서
width값을 수정하거나 없애거나....(디자인은 스스로 알아서 해야하기 때문에)
샘플로 수정전과 후의 모습 눈으로 보기.....
이건 수정전의 모습이구요....
아래 이미지는 수정후의 모습입니다....
참고
http://www.xpressengine.com/qna/19634219