최신글,게시판등의 리스트 배경색 다르게 나타내기 정보
최신글,게시판등의 리스트 배경색 다르게 나타내기
본문
<style>
.list0 {background-color:#EEF3F6; height:28px; font-size:9pt;}
.list1 {background-color:#F7FAFB; height:28px; font-size:9pt;}
</style>
<table width=97% cellpadding=0 cellspacing=0>
<!-- 목록 -->
<?$coloring=0;?>
<? for ($i=0; $i<count($list); $i++) { ?>
<tr height=28 align=center class='list<?=$coloring%2?>'>
<td colspan="<?=$colspan?>" >내용 </td>
</tr>
<?$coloring++?>
<tr>
<td colspan="<?=$colspan?>" height="1" bgcolor="#EEEEEE"></td>
</tr>
<?}?>
<? if (count($list) == 0) { ?>
<tr>
<td colspan='$colspan' height=30 align=center>게시물이 없습니다.</td>
</tr><? } ?>
</table>
아시는 분들이 더 많으시겠습니다만, 초보참고용으로 적습니다.
리스트가 증가될수록 순차적으로 리스트배경색이 다르게 나옵니다.
.list0 {background-color:#EEF3F6; height:28px; font-size:9pt;}
.list1 {background-color:#F7FAFB; height:28px; font-size:9pt;}
</style>
<table width=97% cellpadding=0 cellspacing=0>
<!-- 목록 -->
<?$coloring=0;?>
<? for ($i=0; $i<count($list); $i++) { ?>
<tr height=28 align=center class='list<?=$coloring%2?>'>
<td colspan="<?=$colspan?>" >내용 </td>
</tr>
<?$coloring++?>
<tr>
<td colspan="<?=$colspan?>" height="1" bgcolor="#EEEEEE"></td>
</tr>
<?}?>
<? if (count($list) == 0) { ?>
<tr>
<td colspan='$colspan' height=30 align=center>게시물이 없습니다.</td>
</tr><? } ?>
</table>
아시는 분들이 더 많으시겠습니다만, 초보참고용으로 적습니다.
리스트가 증가될수록 순차적으로 리스트배경색이 다르게 나옵니다.
추천
0
0
댓글 2개
정말 감사합니다! ^-^/
유용하게~~