PHP outputs a code example of a multiplication table
This article mainly introduces the code example for PHP output of the 9-9 multiplication table. This article provides the implementation code directly. For more information, see
?
| 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 |
<! DOCTYPE html PUBLIC "-// W3C // dtd xhtml 1.0 Transitional // EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <Html xmlns = "http://www.w3.org/1999/xhtml"> <Head> <Meta http-equiv = "Content-Type" content = "text/html; charset = UTF-8"/> <Title> 9-9 multiplication table </title> <Link href = "mult9_9.css" rel = "stylesheet" type = "text/css"/> </Head> <Body> <Table border = "1" cellpadding = "0" cellspacing = "0" class = "tableStyle"> <Caption> <H1> 9-9 multiplication table </Caption> <? Php For ($ I = 1; $ I <= 9; $ I ++) { Echo ("<tr> "); For ($ j = 1; $ j <= $ I; $ j ++) { Echo ("<td align = \" center \ "width = \" 100 \ "height = \" 40 \""); If ($ I = $ j) { Echo ("style = \" color: # FF0 \""); } Echo ("> "); $ S = $ I * $ j; Echo "$ I * $ j = $ s "; Echo ("</td> "); } Echo ("</tr> "); } ?> </Table> </Body> |