var strTabl="<table border=1><tbody>\n"; for (k = 0; k < 4; k++) { strTabl+= "\n<tr>\n"; for (m = 0; m < 5; m++) { strTabl+= "<td>"+"строка " +k+"; яч "+m+"</td>"; } strTabl+= "\n</tr>\n"; } strTabl+= "\n</tbody></table>"; alert(strTabl);