alright well i have no idea what your problem is then.. i tried this and it works fine..
that works fine.. all i changed was i took out your <td></td> tags. also note in your original post you were missing a closing > on the first td..
$title = "What's happening";
echo '<a href="makeAvailable.php?id='.$id.'" onclick="return confirm(\'Are you sure you want to share '. addslashes($title) .'?\')">Share this item</a>';
and i added addslashes.