그누보드5 게시판 목록에서 한줄은 색이 회색이고 한줄은 하얗게 하려면 style을 어떻게 수정해야 되나요?
본문
그누보드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>';
}
}