<style type="text/css">
table {color: red; background: #98AB6F no-repeat scroll 5% 60%;text-align : center;}
div {color: red; background: #00AB60;text-align : center;width:200;font-size:12px}
</style>
<form id="form1">
<input type="textbox" style="display:none"/><br>
<table>
<tr>
<script>
for(var i=0;i<20;i++)
{
document.write("<td>" + i + "<input type='checkbox' id='che" + i + "'/></td>");
if(!((i+1)%5))
{
if(!(i+1 == 20))
document.write("</tr><tr>");
}
}
function allcheck(obj)
{
for(var i=1;i < form1.elements.length;i++)
{
if(form1.elements[i].type == "checkbox")
form1.elements[i].checked = obj.checked;
}
}
</script>
</tr></table><br><div>全选/全消<input type="checkbox" onclick="allcheck(this)"/>
</div></form>