Categories and Subcategories in SELECT tag

i would love to achieve this as shown in d pic.
i want a category and its subcategory (if it exists) to be shown in the same select tag as shown in the pic. Is it Possible?

subcategories.jpg

Hi,
I don’t know if I’ve understood.
You can make a hierarchical grid grouped on main category and then a sub grid with details of subcategories.
see image.

cAT.png

Its actually not like that…
This is to be implemented on a form. The system is to track expenses grouped into categories and subcategories (2nd image). the user enters a an expense item, then chooses a category or subcategory it falls into. Not all expense items fall into subcategories. I wanted to put the category & subcategory into a select tag as shown in my first picture. don’t know if that is possible.
I can do it via two select tags (like state and city example) but that would really be double work for the end user.
I guess you get what am trying to do.
Ohh…a select tag is aka drop-down box