How can I lists the contacts like below:
I created categories and contacts from components and assigned it in a menu but display like this:
branch1:
branch2:
branch3:
and other heading titles
How can I accomplish this proper way in joomla 2.5?
Joomla has this feature, however it will require some work from you, if you wish to have it styled like you do in your question.
Firstly, you will need to create a new Menu Item and set the "type" to "List Contact in a Category". Select the category, save it, and when you go to the page, you will see the list.
To change the structure, don't go changing all of the core CSS file and PHP files. Instead, do a Template Override.
In your case, the file that will need to be changed is:
components/com_contact/views/category/tmpl/default.php
All you need to do is create the following directory structure if you dont have it already:
templates/YOUR_TEMPLATE/html/com_contact/category
then copy the default.php
from the first directory, to your newly create one and start editing to suit your needs
Hope this helps