add delete table rows

add delete table rows

I have a table in which I have 3 columns.  On the firs row, last column contain a button "save". 
 
On clicking Save, the button saved is changed to a delete button and it has to insert a new row above the row. 
 
On clicking the button delete, the row has to be removed. 
 
How can I do this?