Show tooltip above stationary table header

I am having trouble getting a tooltip to display over a fixed scrolling header within a jquery datatable. To better illustrate the issue, I have created a jsfiddle:

http://jsfiddle.net/75e4ssgv/4/

Here is the sample HTML code:

<section>
    <h2>I am content</h2>
</section>
<section class="content">
        <div><span data-tooltip="other text i want to see">Other text</span></div>
        <div><span data-tooltip="some text i want to see">Text</span></div>
</section>

The css applied by datatables forces certain styles on the container, making its contents scrollable.

Despite trying different approaches with the css of the tooltip, such as adjusting the z-index and adding position: absolute, the desired results have not been achieved. Adding position: absolute causes the text to be misplaced within the table.

Is there a way to make the tooltip appear outside the container without using position: absolute?

Answer №2

Following careful consideration, we decided to include additional override rules in the CSS file:

table tr:first-child [data-tooltip]:hover:after {
    position: absolute;
    bottom: -60%;
    right: 170%;
}
table tr:first-child [data-tooltip]:hover:before {
    position: absolute;
    bottom: -35%;
    right: 140%;
    border-left: 20px solid orangered;
    border-top: 2px solid transparent;
    border-bottom: 18px solid transparent;
}

By implementing these changes, the tooltip will now appear to the left of the content if it cannot be displayed above.

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

Firefox failing to interpret nested element background

I'm facing an unusual problem with Firefox while developing a menu that has a maximum of three levels. The issue seems to be isolated to Firefox as everything works perfectly in Chrome. When I click on 'First Level Menu', a ul opens with two ...

Top tips for seamless image transitions

Currently working on a slideshow project and aiming to incorporate smooth subpixel image transitions that involve sliding and resizing, similar to the Ken Burns effect. After researching various techniques used by others, I am curious to learn which ones ...

What is the best way to position two text fields next to each other on a webpage?

As I design a form for a landing page, my goal is to arrange the text input fields side by side in order to avoid making the form too lengthy. I am striving to achieve a layout similar to this: https://i.sstatic.net/PTCr4.png However, the task seems quit ...

Load a section of the webpage without using AJAX technology

I am creating a website and I would like the left menu to remain fixed while loading the content of the clicked option. Currently, each menu link uses AJAX to return the requested content. Although it works well, I would like to find an alternative to avo ...

Images do not appear on Bootstrap Carousel as expected

I am facing an issue where the images are not displaying on my bootstrap carousel or when I try to display them individually using their class. I am utilizing bootstrap and express for my project. I have verified multiple times that the file path to the im ...

Creating a new image by extracting a specific HTML div tag that contains an image and its layers

I currently have a div element that includes an image element along with multiple other div elements containing small text displayed above the image. I am looking to save the image along with its content to a new image file. Any suggestions or ideas are ...

Tips for updating CSS styles for multiple innerHTML elements using a JavaScript for loop

<div id="test"></div> <script type="text/javascript"> window.names=["jin kazama", "nina williams"]; window.values=[25, 37]; len=names.length for (var i = 0; i < len; i++) { document.getElementById('test').innerHTML+ ...

What could be causing the absence of a background image in CSS?

When I try to view my local desktop file, the CSS background image isn't showing up. Here's the code I'm using: <!DOCTYPE HTML> <html> <head> <meta charset="UTF-8"> <link rel="stylesheet" text="type/css" href="dis ...

The CSS dropdown menu appears in a horizontal layout rather than vertical

** body { background-color: #9cb4c0; background-size: 100% 100%; } .div-1 { float: right; padding: 20px 10px; } h2 { text-align: right; ...

What happens when a browser can support multiple versions of a font - which one does it choose

If I have two versions of a font, customFont1.woff2 and customFont1.woff, and I list the woff2 version first followed by the woff version in the font declaration file, what happens when the browser supports both formats? Will it download both fonts or ju ...

Learn how to display or conceal the HTML for 'Share this' buttons on specific routes defined in the index.html file

Currently, I am in the process of updating an existing Angular application. One of the requirements is to hide the "Share this buttons" on specific routes within the application. The "Share" module typically appears on the left side of the browser window a ...

HTML/ModX styling for selected textboxes

I am looking to enhance the style of my search-box, which is similar to the one on THIS website. While I have tried using :active, the effect only lasts for a brief moment. Currently, my code is heavily influenced by modX terms, but I will still share it h ...

Display the button only if the specified condition aligns with the input data

I am working on a project where I have an input text field that retrieves data from a database using a combination of JavaScript and PHP. get.html is responsible for fetching the data through JavaScript. function showUser(str) { if (str == "") { ...

Issue with Bootstrap/Bootswatch Dropdown Tab Not Showing Up

I am encountering an issue while trying to implement a tab with a dropdown navigation, similar to the examples shown on Bootswatch. Interestingly, it seems that this functionality is not working properly even on the demo page provided by Bootswatch. My ma ...

The size of the elements inside a div should be proportional to its parent div

I am struggling with sizing elements within a div. I have set the max-width to 40% and max-height to 25%, and inside is an image that I want to be 80% of its parent div. Here is the code snippet for reference: <div className="inputbox-container&qu ...

Can an image be inserted at the top left corner of a div's border by cropping the border?

I'm struggling to replicate a specific image design where the border cuts off within a certain distance. Despite my best efforts, I can't seem to achieve the desired cut-off effect for the border. Below is the HTML code for the quote and image: ...

Trigger a fire event upon entering a page containing an anchor

My query is similar to this particular one, with slight differences. I am working on a page that includes an anchor, such as page.html#video1. Within this page, there are multiple sections identified by ids like #video1, #video2. Each section comprises of ...

Sass compilation with source mapping

Is there a more efficient method to compile my sass files with sourcemap enabled other than using the command below? sass --compass --sourcemap --style compact --watch sass:css In the case of utilizing compass, 'compass watch' would be the pref ...

Design the border of the highlighted section within the table using CSS

Is there a way to access the edge (top, left, right, bottom) width css for a selectable table using jQuery UI selectable, or do I need to use JavaScript? Update: By "accessing the edge," I mean creating a border around a selected area in a table (selectin ...

Finding the location of an "Apply" button on an Angular HTML page

There is an issue with the positioning of the apply button in the filter bar. Sometimes it displays in the next row instead of alongside the other filters. How can I determine the exact position of this apply button within the HTML page? <div class=&quo ...