One line in jquery:
$('ul.nav li a').each(function(){
$(this).parent().width($(this).width() + 4);
});
edit: While this can bring about the solution, one should mention that it does not work in conjunction with the code in the original post. "display:inline" has to be replaced with floating-parameters for a width-setting to be effective and that horizontal menu to work as intended.