랜덤관련 스크립트 알려주세요. 정보
랜덤관련 스크립트 알려주세요.본문
페이지 열릴때 , 지정된 테이블 셀에 바탕색이 랜덤으로 보여지는 그런 소스알려주세요.
검색하다가 지쳐서..
검색하다가 지쳐서..
추천
0
0
댓글 6개

이런식으로 말씀인가요?
<style>
#randomcell {background-color:rgb(<?=rand(0,255)?>,<?=rand(0,255)?>,<?=rand(0,255)?>)}
</style>
<table>
<tr>
<td id="randomcell">이 셀은 바탕색이 랜덤이라네</td>
<td>여기는 아니라네</td>
</tr>
</table>
<style>
#randomcell {background-color:rgb(<?=rand(0,255)?>,<?=rand(0,255)?>,<?=rand(0,255)?>)}
</style>
<table>
<tr>
<td id="randomcell">이 셀은 바탕색이 랜덤이라네</td>
<td>여기는 아니라네</td>
</tr>
</table>
역시 말러님..고맙습니다..~
셀이 여러개 있고 아이디를 지정했을때 각셀의 색상이 다르게 랜덤으로 나오는 방법은 있나요?..
스타일로는 힘들겠고 스크립트라도 있으면 알려주세요..
스타일로는 힘들겠고 스크립트라도 있으면 알려주세요..

<style>
.cell1 {background-color:#FF0;}
.cell2 {background-color:#F0F;}
.cell3 {background-color:#0FF;}
</style>
<table>
<tr>
<td class="cell<?=rand(1,3)?>">랜덤셀</td>
<td class="cell<?=rand(1,3)?>">랜덤셀</td>
<td class="cell<?=rand(1,3)?>">랜덤셀</td>
<td>이건아님</td>
</tr>
</table>
이런건 어때요?
.cell1 {background-color:#FF0;}
.cell2 {background-color:#F0F;}
.cell3 {background-color:#0FF;}
</style>
<table>
<tr>
<td class="cell<?=rand(1,3)?>">랜덤셀</td>
<td class="cell<?=rand(1,3)?>">랜덤셀</td>
<td class="cell<?=rand(1,3)?>">랜덤셀</td>
<td>이건아님</td>
</tr>
</table>
이런건 어때요?

직접적인 관련은 없지만, 이것도 참고해보세요.
http://gnucomun.net/sp/study.12.1
http://gnucomun.net/sp/study.12.1
좋은 소스 잘보았습니다. 감사합니다.