1 <!DOCTYPE HTML>2 <HTML>3 <Head>4 <MetaCharSet= "UTF-8">5 <title></title>6 <Scripttype= "Text/javascript">7 8 /*9 * 1. Print 99 multiplication TableTen * 1*1=1 One * 1*2=2 2*2=4 A * 1*3=3 2*3=6 3*3=9 - * 1*4=4 2*4=8 3*4=12 4*4=16 - * .... 9*9=81 the * - * 2. Print out all the prime numbers between 1-100 - */ - + //------------------------------------------------------------------------- - + //Create an outer loop to control the height of the multiplication table A for(varI=1; I<=9; I++ ){ at //Create an inner loop to control the width of the graphic - for(varJ=1; J<=i; J++){ - document.write ("<span>"+J+"*"+I+"="+I*J+"</span>"); - } - - //output a line break in document.write ("<br/>"); - to } + - the </Script> * <styletype= "Text/css"> $ Panax Notoginseng Body{ - width:2000px; the } + A span{ the Display:Inline-block; + width:80px; - } $ $ </style> - </Head> - <Body> the </Body> - </HTML>
JS Basic _ Print 99 multiplication table