title: All rows are one column - PHP created table
body: <p>I need to create 3 functions to create a table using PHP.  But I keep getting all data in one row.  It also doesn't look like its the most efficient way to do it.  Can someone tell me what is wrong since it looks like all of the td's are showing up like tr's?</p>
  
  <pre><code>&lt;html&gt;
  &lt;head&gt;&lt;/head&gt;
  &lt;body&gt;
  &lt;?php
  
  
  function tdFunction1($flavor1, $flavor2, $flavor3)
  {
      echo "&lt;td&gt;";
      echo $flavor1;
      echo "&lt;/td&gt;";
      echo "&lt;td&gt;";
      echo $flavor2;
      echo "&lt;/td&gt;";
      echo "&lt;td&gt;";
      echo $flavor3;
      echo "&lt;/td&gt;";
  }
  
  function tdFunction2($dessert1, $dessert2, $dessert3)
  {
      echo "&lt;td&gt;";
      echo $dessert1;
      echo "&lt;/td&gt;";
      echo "&lt;td&gt;";
      echo $dessert2;
      echo "&lt;/td&gt;";
      echo "&lt;td&gt;";
      echo $dessert3;
      echo "&lt;/td&gt;";
  }
  
  function tdFunction3($temp1, $temp2, $temp3)
  {
      echo "&lt;td&gt;";
      echo $temp1;
      echo "&lt;/td&gt;";
      echo "&lt;td&gt;";
      echo $temp2;
      echo "&lt;/td&gt;";
      echo "&lt;td&gt;";
      echo $temp3;
      echo "&lt;/td&gt;";
  }
  
  
  echo "&lt;table border=1 style='width:100%;'&gt;";
  echo tdFunction1("chocolate", "apple", "vanilla");
  echo tdFunction2("Lava Cake", "Cheesecake", "Cream Puffs");
  echo tdFunction3("hot", "cold", "cold");
  echo "&lt;/table&gt;";
  
  
  ?&gt;
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>I switched it around to what I have below but I get a 
  Fatal error: </p>
  
  <blockquote>
    <p>Call to undefined function colFunction1() in C:\xampp\htdocs\Trash\index.php on line 39      (the first of my 3 echo colFunction's)</p>
  </blockquote>
  
  <pre><code>&lt;html&gt;
  &lt;head&gt;&lt;/head&gt;
  &lt;body&gt;
  &lt;?php
  
  function tableFunction()
  {
      echo "&lt;table border=1;&gt;";
  
      function rowFunction()
      {
          echo "&lt;tr&gt;";
          function colFunction1($flavor1, $flavor2, $flavor3)
          {
              echo "&lt;td&gt;".flavor1."&lt;/td&gt;&lt;td&gt;".flavor2."&lt;/td&gt;&lt;td&gt;".flavor3."&lt;/td&gt;";
          }
          echo "&lt;/tr&gt;";
  
  
          echo "&lt;tr&gt;";
          function colFunction2($dessert1, $dessert2, $dessert3)
          {
              echo "&lt;td&gt;".dessert1."&lt;/td&gt;&lt;td&gt;".dessert2."&lt;/td&gt;&lt;td&gt;".dessert3."&lt;/td&gt;";
          }
          echo "&lt;/tr&gt;";
  
  
          echo "&lt;tr&gt;";
          function colFunction3($temp, $temp2, $temp3)
          {
              echo "&lt;td&gt;".temp1."&lt;/td&gt;&lt;td&gt;".temp2."&lt;/td&gt;&lt;td&gt;".temp3."&lt;/td&gt;";
          }
          echo "&lt;/tr&gt;";
      }
  
      echo "&lt;/table&gt;";
  }
  
  echo colFunction1("chocolate", "apple", "vanilla");
  echo colFunction2("Lava Cake", "Cheesecake", "Cream Puffs");
  echo colFunction3("hot", "cold", "cold");
  
  ?&gt;
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>Well I fooled around with it and "think" I figured it out (just in case someone else is as puzzled as I was).<br>
  I created a row function to create another row.
  I created the column function to take the three function inputs.
  Then I created the table to create a table that could be called on its own.
  I PRAY I didnt just print out the echos as they are, but I dont think so.  If I am wrong, please someone point it out to me.</p>
  
  <pre><code>&lt;html&gt;
  &lt;head&gt;&lt;/head&gt;
  &lt;body&gt;
  &lt;?php
  
  function trFunction()
  {
      echo"&lt;tr&gt;";
  
      echo"&lt;/tr&gt;";
  }
  function tdFunction($flavor1, $flavor2, $flavor3)
  {
      echo"&lt;td&gt;".$flavor1."&lt;/td&gt;"; 
      echo"&lt;td&gt;".$flavor2."&lt;/td&gt;";
      echo"&lt;td&gt;".$flavor3."&lt;/td&gt;";
  }
  function tableFunction()
  {
  echo "&lt;table width=400px border=5px cellpadding=3px td style=text-align:center;&gt;";
  echo trFunction();
  echo tdFunction("Chocolate", "Strawberry","Vanilla" );
  echo trFunction();
  echo tdFunction("Molten Lava Cake", "Cheesecake", "Cream Puffs");
  echo trFunction();
  echo tdFunction("Hot","Cold","Cold");
  echo "&lt;/table&gt;";
  }
  
  echo \tableFunction();
  ?&gt;
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>