when I click on the tableView it displays something like this to show details
How can I do this?:
I think what you need is an implementation similar to accordion. Here are some sample reference from where you can start
How to implement an accordion view for an iPhone SDK app?
Accordion table cell - How to dynamically expand/contract uitableviewcell?
Accordion sample tutorial
Accordion sample tutorial 2