Fixed bootstrap-table header not working

I used bootstrap-tableto set the table in my project. Everything works fine except for the scrollbar inside tbody.

There is no scroll bar. What am I missing? I believe that if the scrollbar is visible, then the function fixed-headerfor the table should also work fine.

<table id="tblMain" class="table table-bordered table-hover" data-show-refresh="false" data-click-to-select="false" data-single-select="true" data-show-toggle="false" data-show-columns="false" data-cache="false" data-page-number="@Model.CommonVariable" data-url='@Url.Action("Index", "Home")'  data-side-pagination="server" data-pagination="true" data-search="false" data-query-params="queryParams" data-response-handler="respHandler">
    <thead class="table-head">
        <tr>
            <th data-field="id" data-formatter="SomeFunction">Item ID</th>
            <th data-field="name" data-formatter="SomeFunction2">Item Name</th>
            <th data-field="price" data-formatter="SomeFunction3">Item Price</th>
        </tr>
    </thead>
</table>
+4
source share
2 answers

Check out the fiddle ...

It was not created by me, but I think that this is what you are looking for.

    table {
        table-layout:fixed;
    }

    .div-table-content {
      height:150px;
      overflow-y:auto;
    }
+2
source

Source: https://habr.com/ru/post/1583852/


All Articles