Bootstrap table won't fill container width

前端 未结 8 1109
春和景丽
春和景丽 2020-12-24 04:43

I\'m writing a web site using bootstrap (3.3.2) with a simple table on one of the pages. I just have a simple header panel in one container, and another content container w

相关标签:
8条回答
  • 2020-12-24 05:19

    In most simple words !!

    Create responsive tables by wrapping any .table in .table-responsive to make them scroll horizontally on small devices (under 768px). When viewing on anything larger than 768px wide, you will not see any difference in these tables.

    So for your requirement .table and .table-responsive will help you.

    0 讨论(0)
  • 2020-12-24 05:25

    This solution worked for me:

    just add another class into your table element: w-100 d-block d-md-table

    so it would be : <table class="table table-responsive w-100 d-block d-md-table">

    for bootstrap 4 w-100 set the width to 100% d-block (display: block) and d-md-table (display: table on min-width: 576px)

    <div class="table table-responsive w-100 d-block d-md-table">
    <table class="table">
     ---
    </table>
    </div>
    
    0 讨论(0)
提交回复
热议问题