First off, I'm not sure if this thread belongs in the css or JavaScript forum. I'm working on integrating tool-tips into a table in an application I'm working on. I have the tool-tips working the way I would like them to with one exception. If the tool-tip loads on an element on the far right side of the page the tool-tip will load off the screen and is impossible to view.

I've created a full example to demonstrate this problem. Simply load this HTML file and go to the cells on the right side of the screen. Hover your mouse over the right edge of the right-most cell and you will be unable to see the tool-tip. I've been stuck on this issue for a while, I'd appreciate any advise you could offer.

Code HTML4Strict:
<!DOCTYPE html
  PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
   <head>
		<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.6.0/jquery.min.js"></script>
		<script type="text/javascript">
		  $(document).ready(function() {
			loadTooltip();
		  });
 
			loadTooltip = function(){
				$('.show-tooltip-text').each(function(){
					var toolTip = $(this);
					if(toolTip.parent().is(':visible')){
						toolTip.parent().hover(showTooltip, hideTooltip);
					}else{
						toolTip.parent().show();
						toolTip.parent().hover(showTooltip, hideTooltip);
						toolTip.parent().hide();
					}
				});
			};
 
			showTooltip = function(e)
			{
				var text = $('.show-tooltip-text', this);
				if (text.attr('class') !== 'show-tooltip-text'){
					return false;
				}
 
				text.fadeIn(0)
					.css('top', e.pageY)
					.css('left', e.pageX+10);
 
				return false;
			};
 
			hideTooltip = function(e)
			{
				var text = $('.show-tooltip-text', this);
				if (text.attr('class') !== 'show-tooltip-text'){
					return false;
				}
 
				text.fadeOut(0);
			};
		</script>
		<style type="text/css">
		table tr td{
			border: 1px solid #000;
			padding: 4px;
		}
 
		span.show-tooltip-text {
			background-color:#FFFDF0;
			border:1px solid #000;
			color:black;
			display:none;
			font-size:.9em;
			font-weight:normal;
			padding:6px;
			padding-left:12px;
			padding-right:12px;
			position:absolute;
			z-index:9999;
		}
 
		span.show-tooltip-text div span {
			font-weight:bold;
		}
		</style>
</head>
<body>
	<table>
		<tr>
			<td><span class="show-tooltip-text"><div>Some Tooltip Text</div><div>Some Tooltip Text</div><div>Some Tooltip Text</div></span>Test Content Test Content Test Content Test Content</td>
			<td><span class="show-tooltip-text"><div>Some Tooltip Text</div><div>Some Tooltip Text</div><div>Some Tooltip Text</div></span>Test Content Test Content Test Content Test Content</td>
			<td><span class="show-tooltip-text"><div>Some Tooltip Text</div><div>Some Tooltip Text</div><div>Some Tooltip Text</div></span>Test Content Test Content Test Content Test Content</td>
			<td><span class="show-tooltip-text"><div>Some Tooltip Text</div><div>Some Tooltip Text</div><div>Some Tooltip Text</div></span>Test Content Test Content Test Content Test Content</td>
			<td><span class="show-tooltip-text"><div>Some Tooltip Text</div><div>Some Tooltip Text</div><div>Some Tooltip Text</div></span>Test Content Test Content Test Content Test Content</td>
			<td><span class="show-tooltip-text"><div>Some Tooltip Text</div><div>Some Tooltip Text</div><div>Some Tooltip Text</div></span>Test Content Test Content Test Content Test Content</td>
			<td><span class="show-tooltip-text"><div>Some Tooltip Text</div><div>Some Tooltip Text</div><div>Some Tooltip Text</div></span>Test Content Test Content Test Content Test Content</td>
			<td><span class="show-tooltip-text"><div>Some Tooltip Text</div><div>Some Tooltip Text</div><div>Some Tooltip Text</div></span>Test Content Test Content Test Content Test Content</td>
			<td><span class="show-tooltip-text"><div>Some Tooltip Text</div><div>Some Tooltip Text</div><div>Some Tooltip Text</div></span>Test Content Test Content Test Content Test Content</td>
			<td><span class="show-tooltip-text"><div>Some Tooltip Text</div><div>Some Tooltip Text</div><div>Some Tooltip Text</div></span>Test Content Test Content Test Content Test Content</td>
		</tr>
		<tr>
			<td><span class="show-tooltip-text"><div>Some Tooltip Text</div><div>Some Tooltip Text</div><div>Some Tooltip Text</div></span>Test Content Test Content Test Content Test Content</td>
			<td><span class="show-tooltip-text"><div>Some Tooltip Text</div><div>Some Tooltip Text</div><div>Some Tooltip Text</div></span>Test Content Test Content Test Content Test Content</td>
			<td><span class="show-tooltip-text"><div>Some Tooltip Text</div><div>Some Tooltip Text</div><div>Some Tooltip Text</div></span>Test Content Test Content Test Content Test Content</td>
			<td><span class="show-tooltip-text"><div>Some Tooltip Text</div><div>Some Tooltip Text</div><div>Some Tooltip Text</div></span>Test Content Test Content Test Content Test Content</td>
			<td><span class="show-tooltip-text"><div>Some Tooltip Text</div><div>Some Tooltip Text</div><div>Some Tooltip Text</div></span>Test Content Test Content Test Content Test Content</td>
			<td><span class="show-tooltip-text"><div>Some Tooltip Text</div><div>Some Tooltip Text</div><div>Some Tooltip Text</div></span>Test Content Test Content Test Content Test Content</td>
			<td><span class="show-tooltip-text"><div>Some Tooltip Text</div><div>Some Tooltip Text</div><div>Some Tooltip Text</div></span>Test Content Test Content Test Content Test Content</td>
			<td><span class="show-tooltip-text"><div>Some Tooltip Text</div><div>Some Tooltip Text</div><div>Some Tooltip Text</div></span>Test Content Test Content Test Content Test Content</td>
			<td><span class="show-tooltip-text"><div>Some Tooltip Text</div><div>Some Tooltip Text</div><div>Some Tooltip Text</div></span>Test Content Test Content Test Content Test Content</td>
			<td><span class="show-tooltip-text"><div>Some Tooltip Text</div><div>Some Tooltip Text</div><div>Some Tooltip Text</div></span>Test Content Test Content Test Content Test Content</td>
		</tr>
	</table>
</body>
</table>

Thanks!