如何根据表格大小放置下拉菜单或下拉列表

问题描述 投票:1回答:1

我在表内有下拉菜单,如果该行下面的表中没有空间,则需要将其更改为下拉菜单。我该如何实现?可以帮个忙吗示例代码http://jsfiddle.net/mhu23/YZx7R/22/

<div ng-controller="MyCtrl">
<div class="container">
    <div class="row">
        <div class="span2">
            <table class="table">
                <tr ng-repeat="row in [1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24]">
                    <td> <a>{{row}}</a>

                    </td>
                    <td>
                        <ul class="nav">
                            <!-- To create dropups instead of dropdowns i could add the class "dropup" to the li-element below. -->
                            <!-- But what I need is an inteligent mechanism that decides when to use dropdown and when to use dropup -->
                            <li class="dropdown pull-right"> <a class="btn-link dropdown-toggle">
                                <i class="icon-align-justify"></i>
                            </a>

                                <ul class="dropdown-menu">
                                    <li ng-repeat="menu in [1,2,3]"> <a class="btn-link">{{menu}}</a>

                                    </li>
                                </ul>
                            </li>
                        </ul>
                    </td>
                </tr>
            </table>
        </div>
    </div>
</div>
css angularjs dropdown
1个回答
0
投票

使用$last属性

类似:

© www.soinside.com 2019 - 2024. All rights reserved.