表格题

<script type="text/javaspript">

document.write('<table>')
for(var a=1; a<=7; a++){
document.write('<tr>')
for(var b=1; b<=8; b++){
document.write('<td>'+'●'+'</td>');
}
document.write('<tr>')
}

//2
document.write('<button onClick="window.print()">')
document.write('<table >')
for(var ab=1; ab<=5; ab++){
document.write('<tr>')
for(var bb=1; bb<=ab; bb++){
document.write('<td>'+'●'+'</td>');
}
document.write('<tr>')
}
document.write('</table>')
document.write('</button>')
document.write('<hr/>')

//3
document.write('<button onClick="window.print()">')
document.write('<table >')
for(var ac=1; ac<=5; ac++){
document.write('<tr>')
for(var bc=4; bc>=ac; bc--){
document.write('<td>'+'□'+'</td>');
}
for(var cc=1; cc<=ac; cc++){
document.write('<td>'+'●'+'</td>');
}
document.write('<tr>')
}
document.write('</table>')
document.write('</button>')
document.write('<hr/>')

posted @ 2018-12-27 23:08  第一代小王  阅读(118)  评论(0编辑  收藏  举报