QUOTE(rockey @ 21 Jun, 2008 - 11:48 AM)

I want to create tables (table 2 to table 5) using while loop, without nested loop.
Why? Do you not like yourself?

The problem is this:
CODE
document.write(d+ "x" + n + "=" + d*n + "<BR>")
n++;
//...
n = 0;
// you print a 0 here. When the loop goes back up, you'll get this exact same thing again, before you hit n++
document.write(d+ "x" + n + "=" + d*n + "<BR>")
Remove that second write and it should work fine. I don't know if you want the zeros, either, considering you start at 1. Also, I'm not sure how this:
while(n<=10, d<=5) even works. You usually just have a single condition in a while loop.
Here's how I'd write what you're trying to do:
CODE
d = 2; //Table 2 to 5
n = 1;
while(d<6) {
document.write(d+ "x" + n + "=" + d*n + "<BR>")
if (++n == 10) {
n = 1;
d++;
}
}
Hope this helps.