Here's an array that should work. Then just iterate through each main category and sub-category and print them out in a table...
$categories = array(
'Main Category One' => array('totalPosts' => 9154,
'subCategories' => array('Sub-Category One' => 4512,
'Sub-Category Two' => 2515,
'Sub-Category Three' => 3245)),
'Main Category Two' => array('totalPosts' => 6245,
'subCategories' => array('Sub-Category One' => 3521,
'Sub-Category Two' => 4153)),
'Main Category Three' => array('totalPosts' => 9233,
'subCategories' => array('Sub-Category One' => 4554,
'Sub-Category Two' => 6444,
'Sub-Category Three' => 7451,
'Sub-Category Four' => 1645)),
);