I know this is an old post but I thought I'd clear things up for others who may be doing the same thing as you based on your comment:
When a record is deleted the deletion process is done by the currently
selected row since I can only select up to row 4, ID 5 can never be
deleted.
You really shouldn't recreate your ids. It messes things up if they are used as keys in another table, plus if you have a large database, recreating them can just waste time when there is really no need to.
What you should do is save an array of the ids along with an array of the entries so you know which id to delete based on which row they selected (or some other way of linking the ids and values so you can grab them later).
In the above example, after someone deletes the row with id 3, your arrays would look like this:
entries = { "a","b","d","e" }
ids = { 1,2,4,5 }
if someone selects "e", which is the fourth item, you simply delete from the table where the id equals the fourth value in the ids array, 5 in this case.
This way if items are constantly being added and removed, your database could end up with ids 2, 34, 56, and 435. It doesn't matter because your code will keep track and know which id to delete.