我正在使用Bootstrap,但我不知道为什么下拉菜单位于左中角。
截图:
代码:
<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>
答案 0 :(得分:38)
将您的代码包含在<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>