Styling for dropdown menu button

I'm encountering an issue with a button styled dropdown. Here is the code snippet:

<template>
  <div class="datatable-wrapper">
    <div class="table-container">
      <table class="table datatable-table is-fullwidth">
        <thead>
          <tr>
            <th class="col-estatus" align="center"gt;
              Action
            </th>
            <th class="col-estatus" align="center">
              id_client
            </th>
            <th class="col-estatus" align="center">
              client_txid
            </th>
            <th class="col-estatus" align="center">
              id_file
            </th>
          </tr>
        </thead>
        <tbody>
          <tr
            v-for="(item, index) in paginatedData"
            :key="index"
          >
            <td class="col-id-cliente" align="center">
              <VDropdown icon="feather:more-vertical">
                <template #content >
                  <div class="dropdown-item pointer" @click="viewDetails(item)"> Details </div>
                  <div class="dropdown-item pointer" @click="opction2"> Option 2 </div>
                  <div class="dropdown-item pointer" @click="opction3"> Option 3 </div>
                </template>
              </VDropdown>                
            </td>
            <td class="col-id-cliente" align="center">{{ item.id_client }}</td>
            <td class="col-id-beneficiario" align="center">{{ item.client_txid }}</td>
            <td class="col-id-cliente" align="center">{{ item.id_file }}</td>
          </tr>
        </tbody>
      </table>
    </div>
    <VFlexPagination
        v-model:current-page="page"
        :item-per-page="itemsPerPage"
        :total-items="data.length"
        :max-links-displayed="7"
        no-router
        class="mt-4"
      />
  </div>
</template>

When I click on the action, this happens:

https://i.sstatic.net/0k2dEQBC.png

As you can see, the dropdown options are not displayed correctly.

I tried adding "position: absolute" to the VDropdown tag, but the action option remains static. So when I scroll horizontally, it overlaps the other columns. What should I do to ensure the dropdown options display correctly?

Answer â„–1

Make sure to update your code with the lines provided below. I have included inline CSS styles in this example, but feel free to use internal or external CSS styles if you prefer.

1) Locate your container Div:

<div class="table-container" style="overflow-x: auto;">

Explanation: This specific style enables horizontal scrolling functionality.

2) Look for the class "col-id-cliente":

<td class="col-id-cliente" align="center" style="position: relative;">

Explanation: By using this style, we ensure that the dropdown is positioned relative to the table cell, allowing it to move along with the content inside the cell.

3) Find the dropdown component in your code:

<VDropdown icon="feather:more-vertical" style="position:absolute; right: 0; z-index: 999;">

Explanation: This particular style guarantees that the dropdown is accurately positioned within the table cell and appears on top of other content due to the use of "z-index".

Give these adjustments a try and see if they help resolve the issue at hand.

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

Creating a Custom Class for a Custom Button in TinyMCE 4 Using addButton()

Is there a way to add a custom class to a custom button using the addButton() function in TinyMCE? Here is an example: editor.addButton('keywords', { text: 'Insert Keywords', class: 'MyCoolBtn', ...

How can I define the boundaries for the scrolling of a static background image?

Is there a way to limit how far a fixed background image can scroll down a page? Essentially, is it possible to change the background attachment to static when the bottom of the background image is 10px away from the bottom edge of its div container? In t ...

Tab panels are shown by Bootstrap 5 tabs

I am using Bootstrap 5 to design a layout that changes based on the width of the screen. When the screen width is greater than or equal to 992 pixels, a table is displayed in the sidebar and some text is shown in the main content area. However, if the scre ...

Exploring the anatomy of the img src tag

Using jQuery, I have successfully implemented code to display an image when clicked by storing the image source into a variable like this: var imgSrc = $(event.target).attr('src'); I then use this variable to add the image to a div and show it o ...

There is a slight gap between the svg element and the path

Here is the size of my path tag (g tag is same size) https://i.sstatic.net/Huk8j.png This is the size of my SVG tag https://i.sstatic.net/VBXQi.png There is a gap between them. These are the inline attributes... <svg preserveAspectRatio="none" cla ...

Generating a new display div element using an anchor link

I've set up a div container with a button that, upon clicking, adds a class to an element in my markup causing it to expand and take over the entire screen. Markup before: <section class="isi" data-trigger="toggle" data-trigger-class="isi--show-i ...

How can I create an image link with a hover effect using HTML and CSS?

I've streamlined my code to focus on the issue at hand - I have an image that changes when hovered over, but how can I make it so that clicking on the image redirects you to a specific website? http://pastebin.com/h83yi3e3 Here is the code snippet: ...

Is there a way to showcase the content of a text file in a sequential manner using Javascript/AJAX?

I am attempting to retrieve text data from a server file and exhibit it within a specific division on my website. Check out the AJAX/Javascript code I have been working with: <body onload="loadXMLDoc()"> <script> function loadX ...

I am looking to identify when the focus event occurs on all HTML input elements on a page without using addEventListener or any HTML attributes

Does anyone know a way to detect the focus event on all HTML input elements on a page without using the addEventListener function or HTML attributes? I was successful in detecting click events with the following code: onclick = () => { // do somethi ...

What is the best way to position an image beside a jquery dialog box?

Apologies for not finding a suitable topic to discuss. Is it possible to place an image next to a jQuery dialog, similar to the following example? If so, how can this be achieved? ...

Is it possible to make side elements expand to occupy the remaining screen space beyond the container?

This is what it's supposed to look like: The goal here is to have the red element on the left expand to fill the remaining space beside its content, as well as the grey on the right. I am utilizing bootstrap which means the center elements occupy 117 ...

When I try to alter HTML using JS, I encounter an undefined error related to AngularJS

Using this specific function: function adjustContent(elemento){ if (document.getElementById(elemento).innerHTML.indexOf('&#10004;')>0){ document.getElementById(elemento).innerHTML=document.getElementById(eleme ...

Stop the span within the paragraph from breaking onto a new line

I have a situation where I need quote symbols to be placed inside span elements that are children of a p element. Each quote symbol requires slightly different CSS styles, and they must be included in the HTML rather than in the CSS due to backend restrict ...

Is there a way to get rid of the "bouncing effect" on my button while using an inline floating-label text input?

When an input with a floating label (Bootstrap 5) is inline with other elements, the elements may appear to jump up and down depending on the position of the floating label. https://i.sstatic.net/kDxBo.gif <link href="https://cdn.jsdelivr.net/npm/bo ...

What is the reason behind genNewColor function's malfunction?

I'm having trouble with this code that is supposed to generate a random color. The CSS formatting works perfectly, but I suspect there might be an issue with the function itself. When I try to run the code, it doesn't produce any error messages â ...

Hide HTML div on click

Why does the button disappear when I click on it, but the status refreshes? Javascript $( ".refreshstatus" ).click(function(){ $( ".navplayers" ).load('stats.php'); }); CSS .refreshstatus{ font-family:'Noto Sans'; font-w ...

Add different input strings to an array within the scope when there is a change in the input value (AngularJS)

My goal is to populate an empty array within the scope with strings. The number of elements in this array can vary depending on what the user types in the player count input field. $scope.playerNames = []; To achieve this, I am using a $watch function th ...

selection menu and advancement gauge

While working on my code, I have a task where I need to make the progress bar move a specific amount when a name is clicked based on the option's value. <!DOCTYPE html> <html> <head> <title>testinggg</title> &l ...

Unable to adjust layout when code is functioning alongside background-color

I'm looking to dynamically change the position of an item on my webpage when it is clicked. Is there a way I can achieve this without relying on id names? I currently have a code snippet that successfully changes the background color, but for some rea ...

"Crafting dynamic buttons with ASP.NET and CSS that adapt to various

Looking for advice on making a popup responsive. Currently experiencing an issue where the buttons go off-screen when adjusting window size, even after using percentages in CSS instead of pixels. Any suggestions? CSS: .modal { display: none; posi ...