We have following files: 1. phpDataGrid.php and 2. saveDataGrid.php
Really it's simple juggling of data around. I have spans for all editable elements so that I can modify their innerHTML easily. I also use labels to get hold of and set the text very easily. I have used the value of button edit (edit and save respectively) to determine modes. After save we get to see either success/Failure at the end of the row.
You can also add delete right next to edit. Also you can have a small form for new row of data somewhere at the start or end of page. This way we can build ASP.Net's DataGridView like page in PHP.
Download the Project from