The difference from the previous table is that there are more restrictions on the number of columns in each row
That is, the first row is one column, the second row is two columns, and so on
So
<code><span><<span>table</span><span>border</span>=<span>"1"</span><span>align</span>=<span>"center"</span><span>width</span>=<span>"800"</span>></span><span><<span>caption</span>></span><span><<span>h1</span>></span>九九乘法表<span></<span>h1</span>></span><span></<span>caption</span>></span><span><span><?php</span><span>for</span> (<span>$i</span> = <span>1</span>; <span>$i</span> < <span>10</span>; <span>$i</span>++) { <span>if</span>(<span>$i</span>%<span>2</span>==<span>0</span>){ <span>$bgc</span>=<span>"#ccc"</span>; } <span>else</span>{ <span>$bgc</span>=<span>"red"</span>; } <span>?></span></span><span><<span>tr</span><span>bgcolor</span>=<span>"<?php echo "</span><span>$bgc"</span> ?></span>"> <span><span><?php</span><span>for</span> (<span>$a</span> = <span>1</span>; <span>$a</span> < <span>$i</span>+<span>1</span>; <span>$a</span>++) { <span>?></span></span><span><<span>td</span>></span><span><span><?php</span><span>echo</span><span>"$a*$i="</span>; <span>echo</span><span>$i</span>*<span>$a</span><span>?></span></span><span></<span>td</span>></span><span><span><?php</span> }<span>?></span></span><span></<span>tr</span>></span><span><span><?php</span> }<span>?></span></span><span></<span>table</span>></span></code>
The above introduces PHP daily 3-21 design of a multiplication table, including aspects of the content. I hope it will be helpful to friends who are interested in PHP tutorials.