Bootstrap collapse extending outside table cell
up vote
0
down vote
favorite
Creating a bootstrap collapse (accordion) inside a table cell as follows:
<table class="table table-striped">
<tr>
<td>...</td>
<td>
<div id="parent">
<div class="">
<a class="btn btn-link" href="#targetDiv" data-toggle="collapse" role="button" aria-expanded="false" aria-controls="targetDiv">Smith, T.</a>
</div>
<div id="targetDiv" data-parent="parent" class="collapse" style="width: 250px">
<div class="row">
<div class="col-4">User Name</div>
<div class="col-8">tsmith</div>
</div>
<div>...</div>
</div>
</div>
</td>
</tr>
</table>
which results in following output (on expanding the collapsed div):
On removing the accordion controls (data-toggle
, data-parent
, etc.), I get the following result which is what I expect for un-collapsed state in the accordion above:
Why is the div
(id="targetDiv") overflowing outside the td
and div
(id="parent") even though it's enclosed inside those two elements?
Note: On un-collapsing the div, i get the desired result (shown in screenshot(2)) for a fraction of a sec and then it goes back to the state shown in the screenshot(1) above.
html css twitter-bootstrap bootstrap-4
add a comment |
up vote
0
down vote
favorite
Creating a bootstrap collapse (accordion) inside a table cell as follows:
<table class="table table-striped">
<tr>
<td>...</td>
<td>
<div id="parent">
<div class="">
<a class="btn btn-link" href="#targetDiv" data-toggle="collapse" role="button" aria-expanded="false" aria-controls="targetDiv">Smith, T.</a>
</div>
<div id="targetDiv" data-parent="parent" class="collapse" style="width: 250px">
<div class="row">
<div class="col-4">User Name</div>
<div class="col-8">tsmith</div>
</div>
<div>...</div>
</div>
</div>
</td>
</tr>
</table>
which results in following output (on expanding the collapsed div):
On removing the accordion controls (data-toggle
, data-parent
, etc.), I get the following result which is what I expect for un-collapsed state in the accordion above:
Why is the div
(id="targetDiv") overflowing outside the td
and div
(id="parent") even though it's enclosed inside those two elements?
Note: On un-collapsing the div, i get the desired result (shown in screenshot(2)) for a fraction of a sec and then it goes back to the state shown in the screenshot(1) above.
html css twitter-bootstrap bootstrap-4
add a comment |
up vote
0
down vote
favorite
up vote
0
down vote
favorite
Creating a bootstrap collapse (accordion) inside a table cell as follows:
<table class="table table-striped">
<tr>
<td>...</td>
<td>
<div id="parent">
<div class="">
<a class="btn btn-link" href="#targetDiv" data-toggle="collapse" role="button" aria-expanded="false" aria-controls="targetDiv">Smith, T.</a>
</div>
<div id="targetDiv" data-parent="parent" class="collapse" style="width: 250px">
<div class="row">
<div class="col-4">User Name</div>
<div class="col-8">tsmith</div>
</div>
<div>...</div>
</div>
</div>
</td>
</tr>
</table>
which results in following output (on expanding the collapsed div):
On removing the accordion controls (data-toggle
, data-parent
, etc.), I get the following result which is what I expect for un-collapsed state in the accordion above:
Why is the div
(id="targetDiv") overflowing outside the td
and div
(id="parent") even though it's enclosed inside those two elements?
Note: On un-collapsing the div, i get the desired result (shown in screenshot(2)) for a fraction of a sec and then it goes back to the state shown in the screenshot(1) above.
html css twitter-bootstrap bootstrap-4
Creating a bootstrap collapse (accordion) inside a table cell as follows:
<table class="table table-striped">
<tr>
<td>...</td>
<td>
<div id="parent">
<div class="">
<a class="btn btn-link" href="#targetDiv" data-toggle="collapse" role="button" aria-expanded="false" aria-controls="targetDiv">Smith, T.</a>
</div>
<div id="targetDiv" data-parent="parent" class="collapse" style="width: 250px">
<div class="row">
<div class="col-4">User Name</div>
<div class="col-8">tsmith</div>
</div>
<div>...</div>
</div>
</div>
</td>
</tr>
</table>
which results in following output (on expanding the collapsed div):
On removing the accordion controls (data-toggle
, data-parent
, etc.), I get the following result which is what I expect for un-collapsed state in the accordion above:
Why is the div
(id="targetDiv") overflowing outside the td
and div
(id="parent") even though it's enclosed inside those two elements?
Note: On un-collapsing the div, i get the desired result (shown in screenshot(2)) for a fraction of a sec and then it goes back to the state shown in the screenshot(1) above.
html css twitter-bootstrap bootstrap-4
html css twitter-bootstrap bootstrap-4
asked 5 hours ago
Bivo Kasaju
5141517
5141517
add a comment |
add a comment |
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53400771%2fbootstrap-collapse-extending-outside-table-cell%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown