Try this:
//get only parents
$args = array(\'orderby\' => \'name\',\'order\' => \'ASC\',\'parent\' => 0);
$Parent_categories = get_categories($args);
foreach($Parent_categories as $category) {
echo \'<p><a href="\'.get_category_link( $category->term_id ).\'">\'.$category->category_nicename.\'</a><br/>\';
//get all children of this category
$args = array(\'orderby\' => \'name\',\'order\' => \'ASC\',\'parent\' => $category->term_id);
$Child_categories = get_categories($args);
foreach ($Child_categories as $c){
echo \'<span class="cat-child"><a href="\'.get_category_link( $c->term_id ).\'">\'.$c->category_nicename.\'</a></span> \';
}
echo \'</p>\';
}