title: HTML table "Add Row" or "Remove Row" button column
body: <p>I need a way to add or remove a row below another row in my html table.  I'm using the dom, and can add and remove rows easily enough, but the problem comes up when I try to have a button column that adds and removes rows dynamically.</p>
  
  <p>For example:</p>
  
  <pre><code>    |  Item Type  |     Item     |  Add/Remove Item
  ====================================================
      |   Fruit &gt;   |     Apple    |   [ Add new ]
  ----------------------------------------------------
      |             |     Mango    |   [ Remove ]
  ----------------------------------------------------
      |             |     Pear     |   [ Remove ]
  ----------------------------------------------------
  </code></pre>
  
  <p>The <code>[Add new]</code> and <code>[Remove]</code> entries in the right column are buttons.  Clicking a <code>[Remove]</code> button would delete the row (remove the pear or mango row).  Clicking the <code>[Add new]</code> button would add a new Item (a new fruit).  </p>
  
  <p>If I specified the html for the button and added a new row based on an onClick, I can't think of a way to keep track of which row the button clicked from to add the new one.  The best way I can think of is to have an array that keeps track of all the item types and what row they are on, then pass the id or name of the item into the method from <code>onClick()</code>, but this seems error-prone and messy. </p>
  
  <p>To solve this, I'm willing to consider any solution (jquery plugin, javascript code, anything).  Can someone point me to the best way to accomplish this?</p>