You can use jQuery's $.getJSON
function:
http://api.jquery.com/jQuery.getJSON/
To fill the table using $.getJSON
as follows:
$.getJSON( "http://localhost/resturant/public/categories/show-categories", function(cat) {
var categories = cat.cat;
//Iterate throught the array
for (var i=0;i<categories.length;i++)
{
category = categories[i];
//Append the category to the table using the format you want
$("#mytable").append("<tr><td>"+category.id+"</td><td>"+category.name+"</td></tr>");
}
})