Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Bootstrap Dropdown in the Wrong Place

I am using Bootstrap but I don't know why the dropdown menu is in the middle-left.

Screenshot:

enter image description here

Code:

<td><button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown">Action <span class="caret"></span></button>
<ul class="dropdown-menu" role="menu" >
<li class="dropdown"><a href="#">Edit</a></li>
<li class="dropdown"><a href="warga/delete/<?php echo $a->id;?>">Delete</a></li>
</ul>
</td>
like image 235
user2699478 Avatar asked May 01 '14 03:05

user2699478


People also ask

How do I change the position of a drop down menu in Bootstrap?

Use data-offset or data-reference to change the location of the dropdown.

What is drop down in Bootstrap?

Dropdowns are toggleable, contextual overlays for displaying lists of links and more. They're made interactive with the included Bootstrap dropdown JavaScript plugin. They're toggled by clicking, not by hovering; this is an intentional design decision. Dropdowns are built on a third party library, Popper.

How do I change the color of a drop down button?

To change the dropdown button color:Wrap your DropdownButton inside the Container . Inside the Container , add the decoration property and assign the BoxDecoration widget. Inside the BoxDecoration add the color property and assign the color of your choice.


1 Answers

Wrap your code within <div class="dropdown"> (Example)

<td>
    <div class="dropdown">
        <button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown">Action <span class="caret"></span></button>
        <ul class="dropdown-menu" role="menu" >
            <li class="dropdown"><a href="#">Edit</a></li>
            <li class="dropdown"><a href="warga/delete/<?php echo $a->id;?>">Delete</a></li>
        </ul>
    </div>
</td>
like image 196
The Alpha Avatar answered Oct 12 '22 01:10

The Alpha