javascript - Bootstrap 按钮下拉列表 - 创建溢出

标签 javascript html css twitter-bootstrap

我正在尝试在表格的最后一列创建一个“操作”下拉列表,但是当您单击该下拉列表时出现溢出。 (见附件截图)

enter image description here

我的 HTML 结构如下:

<table id="app_progress" class="table table-striped">
                    <thead>
                    <tr>
                        <th>Name</th>
                        <th>In Build</th>
                        <th>Signed off</th>
                        <th>In deployment Apple</th>
                        <th>In deployment Android</th>
                        <th>In review Apple</th>
                        <th>In review Android</th>
                        <th>Live Apple</th>
                        <th>Live Android</th>
                        <th>Paid</th>
                        <th>Actions</th>
                    </tr>
                    </thead>
                    <tbody>
                    <!--for loop here that will create a TR all content in the TD based on whats passed in.-->

                    <tr>
                        <!--td>523</td-->
                        <td><a href="#" class="view-form-a">Primary</a></td>
                        <!-- in_build column -->
                                                    <td><a href="#" class="tick-anchor"><span aria-hidden="true" class="glyphicon glyphicon-remove"></span></a></td>

                        <!-- signed_off column -->
                                                    <td><a href="#" class="tick-anchor"><span aria-hidden="true" class="glyphicon glyphicon-remove"></span></a></td>

                        <!-- in_deployment_apple column -->
                                                    <td><a href="#" class="tick-anchor"><span aria-hidden="true" class="glyphicon glyphicon-remove"></span></a></td>

                        <!-- in_deployment_android column -->
                                                    <td><a href="#" class="tick-anchor"><span aria-hidden="true" class="glyphicon glyphicon-remove"></span></a></td>

                        <!-- in_review_apple column -->
                                                    <td><a href="#" class="tick-anchor"><span aria-hidden="true" class="glyphicon glyphicon-remove"></span></a></td>

                        <!-- in_review_android column -->
                                                    <td><a href="#" class="tick-anchor"><span aria-hidden="true" class="glyphicon glyphicon-remove"></span></a></td>

                        <!-- live_apple column -->
                                                    <td><a href="#" class="tick-anchor"><span aria-hidden="true" class="glyphicon glyphicon-remove"></span></a></td>

                        <!-- live_android column -->
                                                    <td><a href="#" class="tick-anchor"><span aria-hidden="true" class="glyphicon glyphicon-remove"></span></a></td>

                        <!-- paid column -->
                                                                            <td><a href="#" class="tick-anchor"><span aria-hidden="true" class="glyphicon glyphicon-remove"></span></a></td>
                                                                        <!-- view app column -->
                        <td>
                            <div class="btn-group open">
                                <button aria-expanded="true" data-toggle="dropdown" class="btn btn-sm btn-default dropdown-toggle" type="button">
                                    Action <span class="caret"></span>
                                </button>
                                <ul role="menu" class="dropdown-menu">
                                    <li><a href="#">Action</a></li>
                                    <li><a href="#">Another action</a></li>
                                    <li><a href="#">Something else here</a></li>
                                    <li class="divider"></li>
                                    <li><a href="#">Separated link</a></li>
                                </ul>
                            </div>
                        </td>
                    </tr>
                     <!--End of If statement-->

                    <tr>
                        <!--td>99786</td-->
                        <td><a href="#" class="view-form-a">Primary School</a></td>
                        <!-- in_build column -->
                                                    <td><a href="#" class="tick-anchor"><span aria-hidden="true" class="glyphicon glyphicon-remove"></span></a></td>

                        <!-- signed_off column -->
                                                    <td><a href="#" class="tick-anchor"><span aria-hidden="true" class="glyphicon glyphicon-remove"></span></a></td>

                        <!-- in_deployment_apple column -->
                                                    <td><a href="#" class="tick-anchor"><span aria-hidden="true" class="glyphicon glyphicon-remove"></span></a></td>

                        <!-- in_deployment_android column -->
                                                    <td><a href="#" class="tick-anchor"><span aria-hidden="true" class="glyphicon glyphicon-remove"></span></a></td>

                        <!-- in_review_apple column -->
                                                    <td><a href="#" class="tick-anchor"><span aria-hidden="true" class="glyphicon glyphicon-remove"></span></a></td>

                        <!-- in_review_android column -->
                                                    <td><a href="#" class="tick-anchor"><span aria-hidden="true" class="glyphicon glyphicon-remove"></span></a></td>

                        <!-- live_apple column -->
                                                    <td><a href="#" class="tick-anchor"><span aria-hidden="true" class="glyphicon glyphicon-remove"></span></a></td>

                        <!-- live_android column -->
                                                    <td><a href="#" class="tick-anchor"><span aria-hidden="true" class="glyphicon glyphicon-remove"></span></a></td>

                        <!-- paid column -->
                                                                            <td><a href="#" class="tick-anchor"><span aria-hidden="true" class="glyphicon glyphicon-remove"></span></a></td>
                                                                        <!-- view app column -->
                        <td>
                            <div class="btn-group">
                                <button aria-expanded="false" data-toggle="dropdown" class="btn btn-sm btn-default dropdown-toggle" type="button">
                                    Action <span class="caret"></span>
                                </button>
                                <ul role="menu" class="dropdown-menu">
                                    <li><a href="#">Action</a></li>
                                    <li><a href="#">Another action</a></li>
                                    <li><a href="#">Something else here</a></li>
                                    <li class="divider"></li>
                                    <li><a href="#">Separated link</a></li>
                                </ul>
                            </div>
                        </td>
                    </tr>
                     <!--End of If statement-->
                    <!--everything goes within the loop-->
                    </tbody>
                </table>

我怎样才能摆脱溢出?

谢谢

最佳答案

dropdown-menu-right 类添加到 ul.dropdown-menu ,它将与按钮的右侧对齐,因此向左扩展。

关于javascript - Bootstrap 按钮下拉列表 - 创建溢出,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/28170744/

相关文章:

javascript - 清除父字段集中的文本框

html - 为什么 Firefox 在折叠边缘时表现不同?

html - 位置 "list-group"在右侧,而 "cards"在左侧,Bootstrap

javascript - 如何判断 jsTree 是否已完全加载?

javascript - 计算(ImmutableJS) map 的所有项目?

jquery - 使导航栏具有粘性

javascript - 使用 Angular Directive(指令)中的参数在 css 中动态转换

javascript - 为mousein和mouseout设置超时,当mouseleave时不等待?

javascript - react native TextInput ref 错误,焦点不是函数

javascript - FF (51.0.1) 中可能存在错误 - 70 度内联旋转的视频无法正确渲染视频控制