그누보드5 게시판 목록에서 한줄은 색이 회색이고 한줄은 하얗게 하려면 style을 어떻게 수정해야 되나요?

그누보드5 게시판 목록에서 한줄은 색이 회색이고 한줄은 하얗게 하려면 style을 어떻게 수정해야 되나요?

QA

그누보드5 게시판 목록에서 한줄은 색이 회색이고 한줄은 하얗게 하려면 style을 어떻게 수정해야 되나요?

본문

3420989166_1521100976.2578.jpg

 

그누보드5 게시판 목록에서 한줄은 색이 회색이고 한줄은 하얗게 하려면 style을 어떻게 수정해야 되나요?

 

<style>
#bo_list .tbl_head01 {}
#bo_list .tbl_head01 table{border-collapse:collapse; border:1px solid #ccc; width:100%;}
#bo_list .tbl_head01 caption {}
#bo_list .tbl_head01 thead th {border:1px solid #ccc;}
#bo_list .tbl_head01 thead a {}
#bo_list .tbl_head01 thead th input {} /* middle 로 하면 게시판 읽기에서 목록 사용시 체크박스 라인 깨짐 */
#bo_list .tbl_head01 tfoot th {}
#bo_list .tbl_head01 tfoot td {border:1px solid #ccc;}
#bo_list .tbl_head01 tbody th {border:1px solid #ccc;}
#bo_list .tbl_head01 td {border:1px solid #ccc; padding:5px;}
#bo_list .tbl_head01 td .lists {border:1px solid #eee; width:100%;}
#bo_list .tbl_head01 a {}
#bo_list td.empty_table {}
#bo_list tr.bg0 { background-color:#fafafa; }
#bo_list tr.bg1 { background-color:#ffffff; }

</style>

 

    <?php
    $cmt_amt = count($list);
    for ($i=0; $i<$cmt_amt; $i++) {
        $comment_id = $list[$i]['wr_id'];
        $cmt_depth = strlen($list[$i]['wr_comment_reply']) * 50;
        $comment = $list[$i]['content'];
        /*
        if (strstr($list[$i]['wr_option'], "secret")) {
            $str = $str;
        }
        */
        $comment = preg_replace("/\[\<a\s.*href\=\"(http|https|ftp|mms)\:\/\/([^[:space:]]+)\.(mp3|wma|wmv|asf|asx|mpg|mpeg)\".*\<\/a\>\]/i", "<script>doc_write(obj_movie('$1://$2.$3'));</script>", $comment);
        $cmt_sv = $cmt_amt - $i + 1; // 댓글 헤더 z-index 재설정 ie8 이하 사이드뷰 겹침 문제 해결
        $bg = $i%2 ? 0 : 1;
     ?>
        <tr class="bg<?=$bg?>">

 

이렇게 하였는데 작동이 안되요 ㅜ

도움 부탁 드려요~

이 질문에 댓글 쓰기 :

답변 2

올려주신 건 코멘트인데요?

게시판 목록은 list.skin.php 파일에서

for ($i=0; $i<count($list); $i++) {

여기 아래에 이렇게 추가하고
$bg = $i%2 ? 0 : 1;

<tr>클래스에 이렇게 추가하면 됩니다.

<tr class="<?php if ($list[$i]['is_notice']) echo "bo_notice"; ?> bg<?php echo $bg ?>">

for($i=0; $i<20; $i++){
    if(($i%2)==0){
        echo '<div style="background:#fff;">a</div>';
    }else{
        echo '<div style="background:#eee;">b</div>';
    }
}

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

회원로그인

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