Show content inline in a cell of a bootstrap 4 table on a large display.









up vote
0
down vote

favorite












Using Bootstrap 4, I have a table with a couple of columns. In tha last column (on the right) I have some buttons that I want to show up next to each other on large screen. I can't get it to work. I tried setting the class of the td elemnt to d-inline to make the content appear inline, but it does not work. I also tried creating a div with the css set to show it inline, but again it did not work. How to fix this so all content of the cell shows inline on a large screen?



My HTML



<div class="container">
<table class="table">
<tr>
<td>
some long text here, well at least long enough to show the effect of the buttons next being next to each other anymore, even on a large display.
</td>
<td>
something else here
</td>
<td>
<button class="btn btn-sm">
some button
</button>
<button class="btn btn-sm">
some button
</button>
<button class="btn btn-sm">
some button
</button>
</td>
</tr>
</table>
</div>


Or as a JSFiddle.










share|improve this question

























    up vote
    0
    down vote

    favorite












    Using Bootstrap 4, I have a table with a couple of columns. In tha last column (on the right) I have some buttons that I want to show up next to each other on large screen. I can't get it to work. I tried setting the class of the td elemnt to d-inline to make the content appear inline, but it does not work. I also tried creating a div with the css set to show it inline, but again it did not work. How to fix this so all content of the cell shows inline on a large screen?



    My HTML



    <div class="container">
    <table class="table">
    <tr>
    <td>
    some long text here, well at least long enough to show the effect of the buttons next being next to each other anymore, even on a large display.
    </td>
    <td>
    something else here
    </td>
    <td>
    <button class="btn btn-sm">
    some button
    </button>
    <button class="btn btn-sm">
    some button
    </button>
    <button class="btn btn-sm">
    some button
    </button>
    </td>
    </tr>
    </table>
    </div>


    Or as a JSFiddle.










    share|improve this question























      up vote
      0
      down vote

      favorite









      up vote
      0
      down vote

      favorite











      Using Bootstrap 4, I have a table with a couple of columns. In tha last column (on the right) I have some buttons that I want to show up next to each other on large screen. I can't get it to work. I tried setting the class of the td elemnt to d-inline to make the content appear inline, but it does not work. I also tried creating a div with the css set to show it inline, but again it did not work. How to fix this so all content of the cell shows inline on a large screen?



      My HTML



      <div class="container">
      <table class="table">
      <tr>
      <td>
      some long text here, well at least long enough to show the effect of the buttons next being next to each other anymore, even on a large display.
      </td>
      <td>
      something else here
      </td>
      <td>
      <button class="btn btn-sm">
      some button
      </button>
      <button class="btn btn-sm">
      some button
      </button>
      <button class="btn btn-sm">
      some button
      </button>
      </td>
      </tr>
      </table>
      </div>


      Or as a JSFiddle.










      share|improve this question













      Using Bootstrap 4, I have a table with a couple of columns. In tha last column (on the right) I have some buttons that I want to show up next to each other on large screen. I can't get it to work. I tried setting the class of the td elemnt to d-inline to make the content appear inline, but it does not work. I also tried creating a div with the css set to show it inline, but again it did not work. How to fix this so all content of the cell shows inline on a large screen?



      My HTML



      <div class="container">
      <table class="table">
      <tr>
      <td>
      some long text here, well at least long enough to show the effect of the buttons next being next to each other anymore, even on a large display.
      </td>
      <td>
      something else here
      </td>
      <td>
      <button class="btn btn-sm">
      some button
      </button>
      <button class="btn btn-sm">
      some button
      </button>
      <button class="btn btn-sm">
      some button
      </button>
      </td>
      </tr>
      </table>
      </div>


      Or as a JSFiddle.







      html css bootstrap-4






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked Nov 10 at 15:20









      Dirk J. Faber

      9001216




      9001216






















          1 Answer
          1






          active

          oldest

          votes

















          up vote
          2
          down vote



          accepted










          You can put a style="white-space:nowrap" style on the table column, which should force things not to wrap inside the cell.



          <div class="container">
          <table class="table">
          <tr>
          <td>
          some long text here, well at least long enough to show the effect of the buttons next being next to each other anymore, even on a large display.
          </td>
          <td>
          something else here
          </td>
          <td style="white-space:nowrap">
          <button class="btn btn-sm">
          some button
          </button>
          <button class="btn btn-sm">
          some button
          </button>
          <button class="btn btn-sm">
          some button
          </button>
          </td>
          </tr>
          </table>
          </div>


          http://jsfiddle.net/qgv9e0jw/



          Alternatively, since you're already using Bootstrap, you can also use their provided text-nowrap class, which does essentially the same thing as above.



          <div class="container">
          <table class="table">
          <tr>
          <td>
          some long text here, well at least long enough to show the effect of the buttons next being next to each other anymore, even on a large display.
          </td>
          <td>
          something else here
          </td>
          <td class="text-nowrap">
          <button class="btn btn-sm">
          some button
          </button>
          <button class="btn btn-sm">
          some button
          </button>
          <button class="btn btn-sm">
          some button
          </button>
          </td>
          </tr>
          </table>
          </div>


          http://jsfiddle.net/ympe2g7w/






          share|improve this answer




















          • That works quite well, thank you. Do you know if there is any class that does this only on large displays? Of course, I could make a css class with a media rule for this, but maybe it already exists?
            – Dirk J. Faber
            Nov 10 at 17:49






          • 1




            Actually maybe, you could make the buttons flex items and change "text-nowrap" to "d-flex flex-wrap flex-lg-nowrap". There might be a "text-lg-nowrap" class but it's not in the doc that I can find. Otherwise media queries would be your best bet
            – Brian Leishman
            Nov 10 at 18:01










          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%2f53240355%2fshow-content-inline-in-a-cell-of-a-bootstrap-4-table-on-a-large-display%23new-answer', 'question_page');

          );

          Post as a guest















          Required, but never shown

























          1 Answer
          1






          active

          oldest

          votes








          1 Answer
          1






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes








          up vote
          2
          down vote



          accepted










          You can put a style="white-space:nowrap" style on the table column, which should force things not to wrap inside the cell.



          <div class="container">
          <table class="table">
          <tr>
          <td>
          some long text here, well at least long enough to show the effect of the buttons next being next to each other anymore, even on a large display.
          </td>
          <td>
          something else here
          </td>
          <td style="white-space:nowrap">
          <button class="btn btn-sm">
          some button
          </button>
          <button class="btn btn-sm">
          some button
          </button>
          <button class="btn btn-sm">
          some button
          </button>
          </td>
          </tr>
          </table>
          </div>


          http://jsfiddle.net/qgv9e0jw/



          Alternatively, since you're already using Bootstrap, you can also use their provided text-nowrap class, which does essentially the same thing as above.



          <div class="container">
          <table class="table">
          <tr>
          <td>
          some long text here, well at least long enough to show the effect of the buttons next being next to each other anymore, even on a large display.
          </td>
          <td>
          something else here
          </td>
          <td class="text-nowrap">
          <button class="btn btn-sm">
          some button
          </button>
          <button class="btn btn-sm">
          some button
          </button>
          <button class="btn btn-sm">
          some button
          </button>
          </td>
          </tr>
          </table>
          </div>


          http://jsfiddle.net/ympe2g7w/






          share|improve this answer




















          • That works quite well, thank you. Do you know if there is any class that does this only on large displays? Of course, I could make a css class with a media rule for this, but maybe it already exists?
            – Dirk J. Faber
            Nov 10 at 17:49






          • 1




            Actually maybe, you could make the buttons flex items and change "text-nowrap" to "d-flex flex-wrap flex-lg-nowrap". There might be a "text-lg-nowrap" class but it's not in the doc that I can find. Otherwise media queries would be your best bet
            – Brian Leishman
            Nov 10 at 18:01














          up vote
          2
          down vote



          accepted










          You can put a style="white-space:nowrap" style on the table column, which should force things not to wrap inside the cell.



          <div class="container">
          <table class="table">
          <tr>
          <td>
          some long text here, well at least long enough to show the effect of the buttons next being next to each other anymore, even on a large display.
          </td>
          <td>
          something else here
          </td>
          <td style="white-space:nowrap">
          <button class="btn btn-sm">
          some button
          </button>
          <button class="btn btn-sm">
          some button
          </button>
          <button class="btn btn-sm">
          some button
          </button>
          </td>
          </tr>
          </table>
          </div>


          http://jsfiddle.net/qgv9e0jw/



          Alternatively, since you're already using Bootstrap, you can also use their provided text-nowrap class, which does essentially the same thing as above.



          <div class="container">
          <table class="table">
          <tr>
          <td>
          some long text here, well at least long enough to show the effect of the buttons next being next to each other anymore, even on a large display.
          </td>
          <td>
          something else here
          </td>
          <td class="text-nowrap">
          <button class="btn btn-sm">
          some button
          </button>
          <button class="btn btn-sm">
          some button
          </button>
          <button class="btn btn-sm">
          some button
          </button>
          </td>
          </tr>
          </table>
          </div>


          http://jsfiddle.net/ympe2g7w/






          share|improve this answer




















          • That works quite well, thank you. Do you know if there is any class that does this only on large displays? Of course, I could make a css class with a media rule for this, but maybe it already exists?
            – Dirk J. Faber
            Nov 10 at 17:49






          • 1




            Actually maybe, you could make the buttons flex items and change "text-nowrap" to "d-flex flex-wrap flex-lg-nowrap". There might be a "text-lg-nowrap" class but it's not in the doc that I can find. Otherwise media queries would be your best bet
            – Brian Leishman
            Nov 10 at 18:01












          up vote
          2
          down vote



          accepted







          up vote
          2
          down vote



          accepted






          You can put a style="white-space:nowrap" style on the table column, which should force things not to wrap inside the cell.



          <div class="container">
          <table class="table">
          <tr>
          <td>
          some long text here, well at least long enough to show the effect of the buttons next being next to each other anymore, even on a large display.
          </td>
          <td>
          something else here
          </td>
          <td style="white-space:nowrap">
          <button class="btn btn-sm">
          some button
          </button>
          <button class="btn btn-sm">
          some button
          </button>
          <button class="btn btn-sm">
          some button
          </button>
          </td>
          </tr>
          </table>
          </div>


          http://jsfiddle.net/qgv9e0jw/



          Alternatively, since you're already using Bootstrap, you can also use their provided text-nowrap class, which does essentially the same thing as above.



          <div class="container">
          <table class="table">
          <tr>
          <td>
          some long text here, well at least long enough to show the effect of the buttons next being next to each other anymore, even on a large display.
          </td>
          <td>
          something else here
          </td>
          <td class="text-nowrap">
          <button class="btn btn-sm">
          some button
          </button>
          <button class="btn btn-sm">
          some button
          </button>
          <button class="btn btn-sm">
          some button
          </button>
          </td>
          </tr>
          </table>
          </div>


          http://jsfiddle.net/ympe2g7w/






          share|improve this answer












          You can put a style="white-space:nowrap" style on the table column, which should force things not to wrap inside the cell.



          <div class="container">
          <table class="table">
          <tr>
          <td>
          some long text here, well at least long enough to show the effect of the buttons next being next to each other anymore, even on a large display.
          </td>
          <td>
          something else here
          </td>
          <td style="white-space:nowrap">
          <button class="btn btn-sm">
          some button
          </button>
          <button class="btn btn-sm">
          some button
          </button>
          <button class="btn btn-sm">
          some button
          </button>
          </td>
          </tr>
          </table>
          </div>


          http://jsfiddle.net/qgv9e0jw/



          Alternatively, since you're already using Bootstrap, you can also use their provided text-nowrap class, which does essentially the same thing as above.



          <div class="container">
          <table class="table">
          <tr>
          <td>
          some long text here, well at least long enough to show the effect of the buttons next being next to each other anymore, even on a large display.
          </td>
          <td>
          something else here
          </td>
          <td class="text-nowrap">
          <button class="btn btn-sm">
          some button
          </button>
          <button class="btn btn-sm">
          some button
          </button>
          <button class="btn btn-sm">
          some button
          </button>
          </td>
          </tr>
          </table>
          </div>


          http://jsfiddle.net/ympe2g7w/







          share|improve this answer












          share|improve this answer



          share|improve this answer










          answered Nov 10 at 15:24









          Brian Leishman

          2,49863462




          2,49863462











          • That works quite well, thank you. Do you know if there is any class that does this only on large displays? Of course, I could make a css class with a media rule for this, but maybe it already exists?
            – Dirk J. Faber
            Nov 10 at 17:49






          • 1




            Actually maybe, you could make the buttons flex items and change "text-nowrap" to "d-flex flex-wrap flex-lg-nowrap". There might be a "text-lg-nowrap" class but it's not in the doc that I can find. Otherwise media queries would be your best bet
            – Brian Leishman
            Nov 10 at 18:01
















          • That works quite well, thank you. Do you know if there is any class that does this only on large displays? Of course, I could make a css class with a media rule for this, but maybe it already exists?
            – Dirk J. Faber
            Nov 10 at 17:49






          • 1




            Actually maybe, you could make the buttons flex items and change "text-nowrap" to "d-flex flex-wrap flex-lg-nowrap". There might be a "text-lg-nowrap" class but it's not in the doc that I can find. Otherwise media queries would be your best bet
            – Brian Leishman
            Nov 10 at 18:01















          That works quite well, thank you. Do you know if there is any class that does this only on large displays? Of course, I could make a css class with a media rule for this, but maybe it already exists?
          – Dirk J. Faber
          Nov 10 at 17:49




          That works quite well, thank you. Do you know if there is any class that does this only on large displays? Of course, I could make a css class with a media rule for this, but maybe it already exists?
          – Dirk J. Faber
          Nov 10 at 17:49




          1




          1




          Actually maybe, you could make the buttons flex items and change "text-nowrap" to "d-flex flex-wrap flex-lg-nowrap". There might be a "text-lg-nowrap" class but it's not in the doc that I can find. Otherwise media queries would be your best bet
          – Brian Leishman
          Nov 10 at 18:01




          Actually maybe, you could make the buttons flex items and change "text-nowrap" to "d-flex flex-wrap flex-lg-nowrap". There might be a "text-lg-nowrap" class but it's not in the doc that I can find. Otherwise media queries would be your best bet
          – Brian Leishman
          Nov 10 at 18:01

















           

          draft saved


          draft discarded















































           


          draft saved


          draft discarded














          StackExchange.ready(
          function ()
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53240355%2fshow-content-inline-in-a-cell-of-a-bootstrap-4-table-on-a-large-display%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







          這個網誌中的熱門文章

          How to read a connectionString WITH PROVIDER in .NET Core?

          Node.js Script on GitHub Pages or Amazon S3

          Museum of Modern and Contemporary Art of Trento and Rovereto