That's basically the design of PHP with different syntax. <?for($i=0;$i<1;$i++){?> <html></html> <?}?>
Nobody uses PHP this way any more though — people treat it like Python or Node and write the entire codebase inside a big <? block
JSP is similar with different syntax again — nobody uses JSP either
I think ASP too but I never used that
If HTML was never able to be the full solution, then I guess if I had to expand on where I'm going, then what the heck are we even doing with this html thing? Either MAKE IT like PHP, ditch it, or do something, anything.
You could have some client side JavaScript handle your for nodes as well. That's how I imagined what OP described actually.
> Nobody uses PHP this way any more though
Well… I have bad news.
I do, for one :-)