Program for Making a table of given row and column where column are filled vertically in increment like 1234....
<!--Program for Making a table of given row and column where the column is filled
vertically in increment like 1234....--> <!DOCTYPE html> <html> <body> <?php $i=8; $j=10; for ($row = 0; $row < $i; $row++) { echo "<table border='1' width='50%'><tr>"; for ($col = 0; $col < $j; $col++) { if($col==0){ echo"<td>".($row+1)."</td>"; $c=($row+1); }else{ echo"<td>".($c+$i)."</td>"; $c=($c+$i); } } echo "</tr></table>"; } ?> </body> </html>
#Output
vertically in increment like 1234....--> <!DOCTYPE html> <html> <body> <?php $i=8; $j=10; for ($row = 0; $row < $i; $row++) { echo "<table border='1' width='50%'><tr>"; for ($col = 0; $col < $j; $col++) { if($col==0){ echo"<td>".($row+1)."</td>"; $c=($row+1); }else{ echo"<td>".($c+$i)."</td>"; $c=($c+$i); } } echo "</tr></table>"; } ?> </body> </html>
#Output
Comments
Post a Comment