phpist

Untitled

Oct 22nd, 2019
191
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.44 KB | None | 0 0
  1. <?php
  2.  
  3. $rows = 10;
  4. $cols = 10;
  5.  
  6. $table = '<table border="3">';
  7.  
  8. for ($tr=1; $tr<=$rows; $tr++){
  9. $table .= '<tr>';
  10. for ($td=1; $td<=$cols; $td++){
  11. if ($tr===1 or $td===1){
  12. $table .= '<th style="color:black;background-color:orangered;">'. $tr*$td .'</th>';
  13. }else{
  14. $table .= '<td>'. $tr*$td .'</td>';
  15. }
  16. }
  17. $table .= '</tr>';
  18. }
  19.  
  20. $table .= '</table>';
  21. echo $table;
  22.  
  23. ?>
Advertisement
Add Comment
Please, Sign In to add comment