title: Proper way to post a new form in each row of a table?
body: <p>I have a page where there is a table. In each row of the table, there is data about an online grocery delivery order. At the end of each row, there is a submit button about action to be performed on the order and the form ends there. A new form begins with the next row &lt;tr&gt;</p>
  
  <p>Where exactly should I put the &lt;form&gt; and &lt;/form&gt; tags? Should I put the &lt;form&gt; before each &lt;tr&gt; and &lt;/form&gt; after the &lt;/tr&gt; or should I introduce them in the first data cell &lt;td&gt; of each row and close in the last &lt;td&gt;?</p>
  
  <p>I mean, the page would probably function all right in both ways, but what is "proper" way of doing this? Right now mozilla code view is showing the table tag in red color.</p>
  
  <p>This is how it looks right now.
  <a href="https://i.stack.imgur.com/EEO80.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/EEO80.jpg" alt="enter image description here"></a></p>
  
  <p>And this is the relevant part of the php code I am using to dynamically generate a new form for each table row. I am posting this just for the sake of reference, because this does not matter at all here. My question is basic HTML based, not php based.</p>
  
  <pre><code>for($i=0;$i&lt;$count;++$i){
      $res.='&lt;form action="" method="post"&gt;' ."\n" .'&lt;input type="hidden" name="orderid" value="' .$orders[$i]-&gt;idcode .'" /&gt;';
      $res.="$nt&lt;tr&gt;&lt;td align=\"center\"&gt;" .$orders[$i]-&gt;display("pe","&lt;/td&gt;&lt;td align=\"center\"&gt;") ."&lt;/td&gt;$nt\t&lt;td align=\"center\"&gt;&lt;select name=\"agent\"&gt;$alistcode&lt;/select&gt;&lt;/td&gt;$nt\t&lt;td align=\"center\"&gt;&lt;select name=\"vendor\"&gt;$vlistcode&lt;/select&gt;&lt;/td&gt;";
      $res.="$nt\t&lt;td align=\"center\"&gt;&lt;input type=\"submit\" value=\"PROCESS\" /&gt;&lt;/td&gt;\n&lt;/tr&gt;\n&lt;/form&gt;\n";
  }
  $res.="&lt;/table&gt;";
  echo $res;
  </code></pre>