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):



enter image description here



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:



enter image description here



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.










share|improve this question


























    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):



    enter image description here



    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:



    enter image description here



    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.










    share|improve this question
























      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):



      enter image description here



      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:



      enter image description here



      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.










      share|improve this question













      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):



      enter image description here



      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:



      enter image description here



      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






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked 5 hours ago









      Bivo Kasaju

      5141517




      5141517





























          active

          oldest

          votes











          Your Answer






          StackExchange.ifUsing("editor", function () {
          StackExchange.using("externalEditor", function () {
          StackExchange.using("snippets", function () {
          StackExchange.snippets.init();
          });
          });
          }, "code-snippets");

          StackExchange.ready(function() {
          var channelOptions = {
          tags: "".split(" "),
          id: "1"
          };
          initTagRenderer("".split(" "), "".split(" "), channelOptions);

          StackExchange.using("externalEditor", function() {
          // Have to fire editor after snippets, if snippets enabled
          if (StackExchange.settings.snippets.snippetsEnabled) {
          StackExchange.using("snippets", function() {
          createEditor();
          });
          }
          else {
          createEditor();
          }
          });

          function createEditor() {
          StackExchange.prepareEditor({
          heartbeatType: 'answer',
          convertImagesToLinks: true,
          noModals: true,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: 10,
          bindNavPrevention: true,
          postfix: "",
          imageUploader: {
          brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
          contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
          allowUrls: true
          },
          onDemand: true,
          discardSelector: ".discard-answer"
          ,immediatelyShowMarkdownHelp:true
          });


          }
          });














           

          draft saved


          draft discarded


















          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






























          active

          oldest

          votes













          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes
















           

          draft saved


          draft discarded



















































           


          draft saved


          draft discarded














          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





















































          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







          Popular posts from this blog

          Berounka

          Sphinx de Gizeh

          Different font size/position of beamer's navigation symbols template's content depending on regular/plain...