title: Php multiplication table for specified number
body: <p>I have a task to create a script which will output multiplication table just for specified number. To create regular multiplication table, for example 10x10 we would write something like this:</p>
  
  <pre><code>echo "&lt;table border=\"1\"&gt;";
  
          for ($r =0; $r &lt; $rows; $r++){
  
              echo'&lt;tr&gt;';
  
              for ($c = 0; $c &lt; $cols; $c++)
                  echo '&lt;td&gt;' .$c*$r.'&lt;/td&gt;';
             echo '&lt;/tr&gt;'; // close tr tag here
  
          }
  
    echo"&lt;/table&gt;";
  </code></pre>
  
  <p>But output which i am supposed to receive, for example for digit "3", should look like this:</p>
  
  <pre><code>|1 x 1 = 1|1 x 2 = 2|1 x 3 = 3|
  | ------- | ------- | ------- |
  |2 x 1 = 2|2 x 2 = 4|2 x 3 = 6|
  |3 x 1 = 3|3 x 2 = 6|3 x 3 = 9|
  </code></pre>
  
  <p>Anyone got an idea how to echo this using php (while and/or for) loops?</p>