var i, j; for(i = 1;i <= 9;i++){ for(j = 1;j <= i;j++){ document.write(j + "*" + i + "=" + (j*i) + " "); } document.write("<br />"); }