bootstrap icon indicating copy to clipboard operation
bootstrap copied to clipboard

tooltip and popover not working on TABLE elements

Open elflo opened this issue 14 years ago • 3 comments

Hey there,

Like the title says, triggering a tooltip or popover javascript on a link inside a TABLE, TR or TD simply does not work, whereas using the exact same code with a DIV, SPAN, etc. works perfectly fine.

Using this javascript:

$(document).ready(function() {
    $('.example').tooltip({ 
        selector: 'A'
    });
});

This does not work: < table class="example" >< a href="#" title="this should show up" >hover me< /a >< /table >

Whereas this works just fine: < div class="example" >< a href="#" title="this should show up" >hover me< /a >< /div >

Is it just me?

(spaces between < > added on purpose to allow HTML code to display on Github)

elflo avatar Apr 22 '12 20:04 elflo

I have noticed the same. Via inspector I can see that the tooltip does get initialized -- the "title" attribute is removed and replaced with "data-original-title" -- but no tooltip displays on hover.

EDIT: My issue turned out to be unrelated to the table it was in. In my case the tooltips resided on an overlayed div. The tooltip was appearing, but with a lower z-index it was hidden underneath my div. My solution (jQuery):

$('.my-link').tooltip({placement: function(tip){
          $(tip).css('z-index',999999);
          return 'bottom';
}});

The tooltip plugin could perhaps be improved by checked the z-index of the target element and incrementing that for the tt element.

markcarey avatar Jun 01 '12 16:06 markcarey

doesn't apear to be aproblem - if you can create a reproducible case in jsfiddle - please reopen this issue. thanks!

fat avatar Jun 03 '12 04:06 fat

SO has answer to this question https://stackoverflow.com/a/36384326/4050261

adarshmadrecha avatar Feb 10 '18 18:02 adarshmadrecha