js基础2作业10

html




    
        
        
    

    
        
用for循环打印十行十列表格,表格里面写1-100,并且隔列变色

css

.even{
    height: 25px;
    width: 100px;
    background-color: beige;
}

.odd{
    height: 25px;
    width: 100px;
    background-color: gold;
}

js

var count = 1
for(var row = 0; row < 10; row++){
    document.write("")
    for(var column = 0; column < 10; column++){
        if(!(column%2)){
            document.write("")
        }else{
            document.write("")
        }
        document.write(count)
        document.write("")
        count++
    }
    document.write("")
}


结果图


js基础2作业10_第1张图片
jsHomework10.png

你可能感兴趣的:(js基础2作业10)