The easiest way, given your current code, is probably:
echo " <a href=\"update.php?id=" . $id . "\">Edit</a> <a href=\"confirm.php?id=" . $id . "\">Delete</a>";
Failing that, I'd personally use the following
CSS:
ul {display: block; }
ul li {display: inline; margin: 0 0.5em; border-left: 1px solid #000; }
ul li:first-child {border-left: 0 none transparent; }
PHP
echo "<ul>";
echo "<li><a href=\"update.php?id=" . $id . "\">Edit</a></li>";
echo "<li><a href=\"confirm.php?id=" . $id . "\">Delete</a></li>";
echo "</ul>";
Incidentally the problem with your code is that, in html, all white-space (outside of <pre> tags or ) is collapsed down to a single space. So the underline of the a element extends into the spaces (as you've coded them, hence my first suggestion) enclosed within the link, and as any spaces between the closing of one a and the opening of the next is then collapsed into a single-space the underline does, indeed, run from one a up to the border of the next and, without trying to check, might even overlap each other, since that white-space is enclosed within the links.
...I might have to re-write that explanation a bit. =/ Hopefully it's useful to you, though. Anyway, that's why I initially removed the white-space from the links, and put it between the links instead.