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.
html css bootstrap-4
add a comment |
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.
html css bootstrap-4
add a comment |
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.
html css bootstrap-4
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
html css bootstrap-4
asked Nov 10 at 15:20
Dirk J. Faber
9001216
9001216
add a comment |
add a comment |
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/
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
add a comment |
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/
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
add a comment |
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/
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
add a comment |
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/
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/
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
add a comment |
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
add a comment |
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%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
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