Table on the absolute position within an overflow scroll container

I'm encountering an issue with a custom select list within a table. The absolute position of the select list is not working properly within the table, causing it to fill the height of the table. My desired outcome is for the select list to overlay the table without affecting its height.

Table code :

<div class="container">
    <div class="row">
        <div class="main">
            <table class="table table-striped mytable">
                <thead class="bg-gradient-pink">
                <tr>
                    <th>title1</th>
                    <th>title2</th>
                    <th>title3</th>
                    <th>title4</th>


                </tr>
                </thead>
                <tbody>

                [Table content here]

                    <td>1</td>
                    <td>2</td>
                    <td>3</td>
                    <td>
                        <select>
                            <option>option1</option>
                            <option>option2</option>
                            <option>option3</option>
                            <option>option4</option>
                        </select>
                    </td>
                </tr>

                [More rows...]

                </tbody>
            </table>
        </div>
    </div>

JS Code :


[JS code provided]

live version : jsfiddle

(In the last row can see some gap added for select list )

Answer №1

To eliminate the extra space at the end of a list, you can simply remove it but keep in mind that it will reappear when the list is expanded to accommodate the content.

An easy solution is to include the following code:

   transform: scale(0);

within the .mydropdown .list class

https://jsfiddle.net/ts81z0vg/

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

Tips for eliminating flicker upon the initial loading of a webpage caused by dynamic changes in CSS styles through JavaScript

Struggling with the load order of my CSS and JavaScript... Currently, I have a div with a blue background that is styled to appear sliced diagonally. However, upon initial page load (or CTRL+SHIFT+R), there's a brief moment where the slice effect doe ...

Launching a React project using the terminal - my step-by-step process

I'm attempting to initiate a new react-app utilizing the command npx create-react-app <app name> as shown below: npx create-react-app new-app However, after downloading, it seems to be stuck. It's not progressing at all. I've even rei ...

Error encountered with MobileFirst version 8 and Angular JS v1.5.3 integration using Bootstrap

I am encountering an issue with my Cordova application that integrates with MobileFirst Platform version 8, Ionic version 1.3.1, and AngularJS version 1.5.3. Upon bootstrapping AngularJS to connect the app to MobileFirst Platform, I encounter the following ...

What steps can be taken to identify the two highest numbers in an array, one being positive and the other

Seeking the optimal solution to resolve this issue Issue: Develop a function called ArrayChallenge (Javascript) that takes a single argument "arr" representing an array of numbers. The function should return the string true if there exist two numbers in t ...

Is it possible to update the version of NPM?

Having an issue with installing packages for my React-Native project due to a NPM version error. How can I upgrade it? Currently using version 4 ...

JavaScript - undefined results when trying to map an array of objects

In the process of passing an object from a function containing an array named arrCombined, I encountered a challenge with converting strings into integers. The goal is to map and remove these strings from an object titled results so they can be converted i ...

Using Scrapy to extract data from Project Euler's website

Currently, I am working on scraping projecteuler.net using Python's scrapy library as a way to practice my skills. While there are existing implementations of similar scrapers online, they seem too complex for my needs. I simply want to save the probl ...

Calculate the minimum, maximum, and average values within an array containing nested elements

I want to calculate the min, max, and average values for nested data that already have these values precalculated. Essentially, I'm looking for the average of averages, min of min, and max of max. I have a large dataset that includes the min, max, an ...

Tips for refreshing a webpage after returning from a redirected page

After utilizing certain logic, I am able to redirect to a new page. return RedirectToAction("Index"); If I navigate back to the previous page using the browser's back button, I would like for the "old" page to automatically update with default valu ...

Setting a pre-selected value in a Vue.js dropdown list involves a few simple steps. This

Currently, I am developing two Vue components. I am sending array data from the parent component to the child component using props. Now, I have a requirement to pre-select a value in the dropdown list of the child component. Below is a snippet of my code ...

Does JavaScript automatically round large numbers?

I have a simple array: myArray = [{"egn":79090114464},{"egn":92122244001},{"egn":10005870397643185154},{"egn":10000330397652279629},{"egn":10000330397652279660},] However, when I append the values from thi ...

Seems like the ng-show events inside are not being triggered, almost like an invisible image

I am encountering an issue where no JavaScript events are triggering inside an ng-show div in my code. You can access my code through the following link on Plnkr: http://plnkr.co/edit/kGqk8x?p=preview Upon loading data from JSON, I set ng-show to true. Ho ...

Guide to creating a sortable element that can act as a droppable area when dragging other sortable items over it

My grid consists of both icons and groups (folders). I want to make both the icons and the groups sortable, with the condition that the groups remain stationary and act as drop targets for the icons. Moving a group within the larger sortable should be feas ...

The Bootstrap Navbar is failing to display the menu options once it collapses

I am currently using Bootstrap 4 and have encountered an issue with the navbar. On a large screen, the navbar appears as shown in this image: https://i.sstatic.net/lIKBC.png. However, when the screen size is reduced and the navbar collapses, the menu optio ...

I'm encountering an issue in my node application where it is unable to access the push

I am a beginner in the world of node.js and express. Whenever I try to start my application using the command npm start, I encounter an error message saying Cannot Read property push of undefined from my index.js file. The problematic code snippet looks l ...

Similar to the filter() method in Vanilla Javascript but behaves in a equivalent way to

Looking to convert some JQuery code to Vanilla JS. $('#myID :not(a, span)').contents().filter( function() { return this.nodeType === 3 && this.data.trim().length > 0;}) .wrap('<span class="mySpanClass" />'); I&a ...

What could be the reason my view is not rendering after calling my action through Ajax?

I am encountering an issue with my Ajax call that is hitting the controller action 'SearchFromWithin'. The problem I am facing is that the view does not get displayed when the call is made. Although I can enter the view and step through it, the s ...

"Anticipate the presence of expression" mistake

On my page, users can choose a registration type and input content into the tinymce textarea to associate that content with the selected registration type. However, an error "expression expected" is appearing in the code below? The console indicates that ...

Navigating through NodeJS-

Summary: After calling the code below once with no issues, I encountered an error the next time I ran it. To resolve the error, I had to restart the server every time after encountering it, but even then, the code only worked once. NOTE: I decided to use ...

What could be the reason for the component bindings being undefined within the controller?

I'm currently working on a basic angular component. I have set up a parameter as a binding and managed to display its value on the screen successfully. The parameter displays correctly, but when I try to access it within the controller, it shows undef ...