pass the value between two table

pass the value between two table

im develop a transaction function here. but im having trouble with jquery . as you can see below, there are two tables. which is the first one is for display the item and the second table is for purchasing. what i want to do is, the row for item in first table is clickable. as the row is click, the item that have been choose come out in the second table. and at the second table cell for discount can be editable and the total price is changing by the discount. is anyone can help me how to pass the value between the two table?

  1.     <fieldset>
  2.     <legend>Item Show</legend>
  3.     <table border="1">
  4.     <tr>
  5.       <td>Item Name</td>
  6.         <td>Item Code</td>
  7.         <td>Manufacturer</td>
  8.         <td>Price</td>
  9.         <td>Stock</td>
  10.     </tr>
  11.     <?php
  12.     while($row = mysql_fetch_array($result))
  13.       {
  14.     ?>
  15.     <tr>
  16.       <td><?php echo $row['item_name']; ?></td>
  17.         <td><?php echo $row['item_code']; ?></td>
  18.         <td><?php echo $row['item_manufacturer']; ?></td>
  19.         <td><?php echo $row['sell_price']; ?></td>
  20.         <td><?php echo $row['stock']; ?></td>
  21.     </tr>
  22.     <?php
  23.     }
  24.     ?>
  25.     </table>
  26.     </fieldset>

  27.     <fieldset>
  28.     <legend>Item Sale</legend>
  29.     <table border="1">
  30.     <tr>
  31.       <td>Item name</td>
  32.         <td>Item Code</td>
  33.         <td>Stock</td>
  34.         <td>Price</td>
  35.         <td>Quantity</td>
  36.         <td>Discount</td>
  37.         <td>Total Price</td>
  38.     </tr>
  39.     </table>
  40.     </fieldset>