Mine using html:


Yours...Dynamically:


Yours with the same format and a little bit of html changes. I did not make it work with the php code:


A test with multiple sub cats


Your updated one:


Second updated one: