Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Bootstrap 3 Table inside a panel overflowing

 <div class="col-xs-6 col-sm-4">
         <div class="panel panel-primary">
          <div class="panel-heading">Recently Filtered</div>
          <table class="table table-striped">
            <tr><td>Sensor ID</td><td>Temperature</td><td>Voltage</td><td>Date</td>
            <tr><td>Sensor ID</td><td>Temperature</td><td>Voltage</td><td>Date</td>
            <tr><td>Sensor ID</td><td>Temperature</td><td>Voltage</td><td>Date</td>
            <tr><td>Sensor ID</td><td>Temperature</td><td>Voltage</td><td>Date</td>
          </table>
        </div>
</div>

The table inside a panel is overflowing when I zoom in, here's a picture exampleenter image description here

What's the proper mark up accommodating this problem? I know that it can scale properly for sure.

like image 333
Aaron Avatar asked Aug 01 '14 00:08

Aaron


People also ask

Is it possible to put a table within the bootstrap panel?

Bootstrap By Building Projects - Includes Bootstrap 4 To create a non-bordered table within a panel, use the class . table within the panel.

How do I stop bootstrap text overflow?

Approach 1: To hide overflown text as ellipsis using CSS properties. Then add its select to element of class col and wrap it within div tag. We can also use d-flex instead of row. Example 1: Below program illustrates how to hide overflown text as ellipsis using dynamic bootstrap cols using CSS properties and Flex.

What is table hover in Bootstrap?

table-hover class, a light gray background will be added to rows while the cursor hovers over them. You can try to run the following code to implement the table-hover class −

What is table condensed in bootstrap?

table-condensed is a class in Bootstrap 3 Framework. It can be used when we want to have row padding half so that we can condense the table. So that I can be more user-friendly.


3 Answers

You could always add .table-responsive class to the table to get it scroll horizontally. Example:

<div class="table-responsive">     <table class="table table-striped">         ...     </table> </div> 

If that isn't what you're wanting, you'll need to lower the font size to make it fit better.

like image 104
South Paw Avatar answered Sep 28 '22 12:09

South Paw


it appears to only happen when the viewport has responded down to mobile sizes. The easiest fix is to add overflow rule.

.panel {
    overflow: auto;
}

you could also change font sizes or remove unneeded table cells. You could also abbreviate

  • ID
  • Temp
  • V
  • Date
like image 35
Todd Avatar answered Sep 28 '22 13:09

Todd


Just an idea, you tryed to add a div with class panel-body around the table?

like image 24
Glaucius Zacher Avatar answered Sep 28 '22 11:09

Glaucius Zacher