jquery¿¡¼ Å×À̺í ¦¼ö, Ȧ¼ö ¹ø° TR ¹è°æ»ö º¯°æÇϱâ |
|
|
 |
8³â Àü |
jquery¿¡¼ Å×À̺í(Ç¥) ¦¼ö ¶Ç´Â Ȧ¼ö ¹ø° TR ¹è°æ»ö º¯°æÇÏ´Â ¹æ¹ýÀÔ´Ï´Ù.
<script>
$(document).ready(function(){
$('table tr:odd').css("backgroundColor","#fff"); // odd Ȧ¼ö
$('table tr:even').css("backgroundColor","#f5f5fc"); // even ¦¼ö
});
</script>
¶Ç´Â
$(document).ready(function(){
jQuery('tr').each(function(i) {
this.style.backgroundColor = (i % 2) ? 'red' : 'blue';
});
});
¡Ø class »ç¿ë
$('.tr_bg:odd').css("backgroundColor","#fff"); |
|
̵̧ : 375 |
̵̧
¸ñ·Ï
|
|