title: Item delete buttons in a table?
body: <p>this is a simple html question but I would like to know the correct way of doing it.</p>
  
  <p>I have a table in my page, with tabular data, and it's a display of items in the database. I build the table dynamically with php, and just output html.</p>
  
  <p>I want to add a column "delete this entry" with a button/link/picture on every line, and when it's clicked, my page refreshes and php knows which itemID should be deleted.</p>
  
  <p>The question is not about php, but about the html part.</p>
  
  <p>How can I make the delete-button compliant with standards? Here's an incorrect solution:</p>
  
  <pre><code>&lt;table&gt;
  &lt;form action='#' method='post'&gt;
  &lt;tr&gt;
  &lt;td&gt;Item 1&lt;/td&gt;
  &lt;td&gt;&lt;input type='hidden' name='id' value='1'&gt;&lt;input type='submit' value='X'&gt;&lt;/td&gt;
  &lt;/tr&gt;
  &lt;/form&gt;
  &lt;form action='#' method='post'&gt;
  &lt;tr&gt;
  &lt;td&gt;Item 2&lt;/td&gt;
  &lt;td&gt;&lt;input type='hidden' name='id' value='2'&gt;&lt;input type='submit' value='X'&gt;&lt;/td&gt;
  &lt;/tr&gt;
  &lt;/form&gt;
  &lt;/table&gt;
  </code></pre>
  
  <p>Anyone an idea on a good solution? I'd prefer not to use much javascript, if it can be avoided.
  Thanks in advance!</p>
  
  <p>Edit: actually, I have a secret second question too: what if i were to want to do inline editing (after pressing an Edit button), as in: make the  cells with the values contain  boxes, and a submit button at the last cell?</p>