question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

table-responsive class does not take full width

See original GitHub issue

This was previously reported in #24256, which was closed after #24438 was merged. However, that merge was only documentation, and the issue doesn’t actually appear to be fixed in Beta 2.

A table with the table-responsive class will not render at full width. I’m not sure why it works in the example in the docs, but this codepen demonstrates that the issue still persists.

<table class="table table-responsive">
  <thead>
    <tr>
      <th>Name</th>
      <th>Description</th>
      <th>Link</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td>David</td>
      <td>Developer</td>
      <td>None</td>
    </tr>
  </tbody>
</table>

screenshot_2017-11-01_12-00-12

screenshot_2017-11-01_12-01-01

The issue occurs on both Firefox 58 and Chrome 62.

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Reactions:11
  • Comments:14 (6 by maintainers)

github_iconTop GitHub Comments

56reactions
browner12commented, Nov 1, 2017

simple solution, use a wrapping <div> with the table-responsive class.

<div class="table-responsive">
    <table class="table"></table>
</div>
6reactions
tmorehousecommented, Nov 1, 2017

In the documentation examples, the reason it appears to “work” is that there is enough content in the table to force it to full width inside the container. Remove a few columns in the example table and you will see that it doesn’t span full width.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Bootstrap 4 responsive tables won't take up 100% width
It's caused by the table-responsive class giving the table a property of display:block , ...
Read more >
How To Create a Full Width Table - W3Schools
Learn how to create a full-width table with CSS. A table that does not have a set width: ... Get certified by completing...
Read more >
Displaying Responsive Tables that are not Full Width
I would like to display a table with no wrapping and collapsible columns (+/- buttons), and at the same time have the column...
Read more >
Bootstrap 4 table responsive - examples & tutorial.
The width of the columns will automatically adjust to the content of the column. This means that it will always take up the...
Read more >
Tables - Bootstrap
Use .table-responsive{-sm|-md|-lg|-xl} as needed to create responsive tables up to a particular breakpoint. From that breakpoint and up, the table will behave ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found