Printable Version of Topic

Click here to view this topic in its original format

HTMLHelp Forums _ Markup (HTML, XHTML, XML) _ Please help

Posted by: ZoSo729 Apr 26 2007, 02:21 PM

Hello,

Im trying to create a loop to display a set of asterisks to create a set of "stairs."

example:
*
**
***
****
*****
******
*******

Im not very good at html and everything Ive tried has failed.

Does anyone have any suggestions or samples?

Thanks a lot, i REALLY appreciate any help at all!

Posted by: Effovex Apr 26 2007, 02:34 PM

You're probably looking for the http://htmlhelp.com/reference/html40/block/pre.html element......what have you tried that has failed?

Posted by: Effovex Apr 26 2007, 04:36 PM

Looks like I misread the question quite a bit. Problem is, that's not an HTML question but a Javascript or CGI/PHP question, and should be in another section.

What you're looking for is something like this (the actual details will vary depending on the language you're using) :
for(a = 1; a<=5; a++)
{
for(b = 1; b<=a; b++)
print "*";
print "<br>";
}

Posted by: stjepan Apr 29 2007, 05:27 AM

Maybe something like this in php:
<html>
<?
for($i = 0; $i < 100; $i++) {
echo "this message has echoed $i times <br>";
}

?>
</html>

or

for($i = 0; $i < 100; $i++) {
some php code
}



Powered by Invision Power Board (http://www.invisionboard.com)
© Invision Power Services (http://www.invisionpower.com)