http://www.php.cn/code/1084.html
Can anyone give me some instructions on this assignment? It cannot be completed
卖女孩的小火柴哟2018-03-05 18:18:35
<?php function renderTable($c0,$c1='red') { $table = '<table border="1">'; for($i=1;$i<10;$i++) { // if ($i%2==0) { // $table .= "<tr bgcolor={$c0}>"; // } else { // $table .= "<tr bgcolor={$c1}>"; // } $table .= "<tr bgcolor='#$i(16-$i)$i'>"; for($j=1;$j<10;$j++) { $table .= '<td>'.$i.'x'.$j.'='.$i*$j.'</td>'; } $table .= '</tr>'; } $table .= '</table>'; return $table; } echo renderTable('blue'); ?>
That’s it
不是铭跃2017-06-06 15:27:50
<?php
echo '<table>';
function demo($color1,$color="pink",$cor=10,$row=10){
for($x=0;$x<$row;$x++){
if($x%2==0){
echo "<tr bgcolor='$color'>";
}else{
echo"<tr bgcolor='$color1'>";
}
for($y=0;$y<$cor;$y++){
echo "<td>".($x.$y)."</td>";
}
echo "<tr>" ;
}
return "<table>";
}
$demo=demo('red');
echo $demo;
?>
清晨的那一抹阳光照耀在我的脸上2017-06-02 14:21:17
This course is not difficult. PHP functions have this fixed grammatical structure, just remember it
【H】™☆Ley2017-06-02 12:43:16
Just help me complete the required homework at the bottom
I don’t know how to do it
I am a newbie
Thank you! ! !
PHPz2017-06-02 11:12:55
Please be specific with your question, otherwise I won’t be able to help you!