Didi
Didi

Reputation: 268

Bootstrap collapse resize table

    <div class="row">
        <div class="col-md-8"> 
            <h3 data-toggle="collapse" data-target="#collapseList" aria-expanded="false" aria-controls="collapseList"> 1 Lecturer List</h3>
            <table class="table table-bordered collapse" id="collapseList">
            <thead>
                <tr>
                    <th>List Id</th>
                    <th>List Name</th>
                    <th>Total Subscribers</th>
                    <th>Action</th>
                    <th>Problems</th>
                </tr>
            </thead>
            <tr>
                <td>a</td>
                <td>abcdefg</td>
                <td>a</td>
                <td>Synchronize</td>
                <td>NOK</td>
            </tr>
            </table>
        </div>
    </div>

This is what I have when I click on the header label, it appears 1 second :

enter image description here

And after 1 second, this is what I have :

enter image description here

Why does my table is resized after the collapsing ? Is there a way to not resize the table ?

UPDATE :

Here's a JSfiddle, you can try and see yourself that there's a problem https://jsfiddle.net/0zw5a845/

Upvotes: 0

Views: 2008

Answers (2)

MPaul
MPaul

Reputation: 2733

Add the following CSS line to your main style sheet. This essentially overwrites the .collapse.in selector of the bootstrap style sheet.

.collapse.in {display:table}

Updated JSFiddle

Upvotes: 2

G.Hunt
G.Hunt

Reputation: 1414

Possibly due to the fact that your div has a class of col-md-8.

If you want a table spanning the full width of a page, change the class to col-md-12.

Upvotes: 0

Related Questions