I am trying to make a tooltip for my application so that when i hover over some writing, a popup appears. The writing that is to be hovered over is not fully visible (ie it is in a table cell with overflow:hidden so the words cut off). I want to display the full writing in a tooltip when hovering over it. I want the tooltip to be fully visible, unaffected by the overflow:hidden of the table cell. Here is what I have so far:
CSS:
.tooltip {
position: relative;
}
.tooltip:hover:after {
background: rgba(0,0,0,.8);
color: #fff;
top: -30px;
left: 10px;
border-radius: 15px;
content: attr(alt);
padding: 5px 15px;
position: absolute;
}
HTML:
<table>
<tr>
<td style="overflow:hidden">
<span alt="reallyLongFullWriting" class="tooltip">partiallyHiddenWriting</span>
</td>
<td></td>
</tr>
</table>
It works like this but the tooltip gets hidden when it overflows as well. Please help me figure out how to make the tooltip fully visible and not partially hidden. Thanks.
Edit: Here is a photo of what seems to be happening: