Bootstrap响应表水平滚动始终可见

时间:2018-05-25 18:22:34

标签: html asp.net .net twitter-bootstrap twitter-bootstrap-3

我在.net网络应用程序中使用响应式引导表来显示信息。每当返回大量信息时,水平滚动条将显示在页面底部。结果,用户必须滚动到底部才能访问水平滚动条以查看当前未在屏幕上显示的信息。我想强制水平滚动条始终可见。我试图添加"位置:绝对"表div标签,但它似乎干扰响应格式。有没有办法在使用响应表时始终显示水平滚动条?

<div id="divGridResults" style="overflow-x: scroll;" runat="server">
        <div class="table-responsive;text-center; ">
            <asp:GridView ID="gvEmployee" runat="server" Width="100%" AutoGenerateColumns="False"
                ClientIDMode="Static" CssClass="table table-striped table-hover table-condensed "
                AllowSorting="True" PagerStyle-CssClass="bs-pagination">
                <Columns>
                    <asp:BoundField DataField="Emp_ID" HeaderText="ID" SortExpression="EMP_ID" />                  
                    <asp:BoundField DataField="First_Name" HeaderText="First Name" SortExpression="First_Name" />
                    <asp:BoundField DataField="Last_Name" HeaderText="Last Name" SortExpression="Last_Name" />
                    <asp:BoundField DataField="Manager" HeaderText="Manager" SortExpression="Manager" />
                    <asp:BoundField DataField="Status" HeaderText="Status" SortExpression="Status" />
                    <asp:BoundField DataField="Address" HeaderText="Address" SortExpression="Address" />
                    <asp:BoundField DataField="City" HeaderText="City" SortExpression="City" />
                    <asp:BoundField DataField="State" HeaderText="State" SortExpression="State" />
                    <asp:BoundField DataField="Zip" HeaderText="Zip" SortExpression="Zip" />
                    <asp:BoundField DataField="Phone" HeaderText="Phone" SortExpression="Phone" />
                    <asp:BoundField DataField="Dept" HeaderText="Department" SortExpression="Dept" />
                </Columns>
                <PagerSettings NextPageText="Next" PreviousPageText="Back" Mode="NumericFirstLast    " />
                <PagerStyle CssClass="bs-pagination" />
            </asp:GridView>
        </div>
    </div>

1 个答案:

答案 0 :(得分:0)

覆盖表响应式CSS

.table-responsive{
    overflow-x: auto !important;
}