[ajax] Space between category/subcategory

[ajax] Space between category/subcategory

hi all,
i'm trying to create a tree menu, each time i click into a category it shows me the subcategories.
My code works fine but i have some spaces between a category and his subcategories, it's not a css problem !
Here is a screenshot :

Image

My code : (jquery)
$.ajax({
type: "GET",
url: "getSub.php",
data: "id=" + id,
dataType: "html",
success: function(msg){
$("#menu ul[name="+ id +"]:first").html(msg).slideDown("slow");
}
});


php/html :
<ul>
// print main categories
while()
{
?>
<li name="<? echo intval($res['id_category']); ?>">
<a href="/sub/<? echo intval($res['id_category']); ?>" name="<? echo intval($res['id_category']); ?>"> <? echo htmlentities($res['name_category']); ?> </a>

<ul name="<? echo intval($res['id_category']); ?>" style="display: none;"></ul>

</li>
<?
}
?>
</ul>


Thanks
Sorry for my bad english