table appending to correct position