<script>
function table(row,col,width,yanse1,yanse2)
{
document.write('<table border="1" width="+width+" align="center">');
for(var i=0;i<row;i++)
{
if(i%2==0)
var yanse=yanse1;
else
var yanse=yanse2;
document.write('<tr bgcolor="'+yanse+'">');
for(var j=0;j<col;j++)
document.write('<td>'+(i*col+j)+'</td>');
document.write('</tr>');
}
document.write('</table>');
}
table(10,10,100,"pink","purple");
table(5,9,30,"gree","red");
</script>
function table(row,col,width,yanse1,yanse2)
{
document.write('<table border="1" width="+width+" align="center">');
for(var i=0;i<row;i++)
{
if(i%2==0)
var yanse=yanse1;
else
var yanse=yanse2;
document.write('<tr bgcolor="'+yanse+'">');
for(var j=0;j<col;j++)
document.write('<td>'+(i*col+j)+'</td>');
document.write('</tr>');
}
document.write('</table>');
}
table(10,10,100,"pink","purple");
table(5,9,30,"gree","red");
</script>