可滚动div

时间:2016-06-27 17:31:53

标签: css twitter-bootstrap

我有两个div,溢出设置为auto,它们包含bootstrap面板。

我试图让两个div同步滚动,这实际上是有效的。

但我面临两个问题。

1)文字被包裹,所以我使用了 white-space:nowrap; ,但后来又引起了第2期。

2)现在我滚动标题时不会延长到身体

任何人都可以请指出如何解决问题。 jsfiddle

感谢!!!

var $divs = $('#generalContainer, #dataContainer');
var sync = function(e){
    var me = $(this);
    var $other = $divs.not(me).off('scroll');
    $divs.not(me).each(function (index) {
        $(this).scrollLeft(me.scrollLeft());
    });
    setTimeout(function () {
        $other.on('scroll', sync);
    }, 10);
}
$divs.on( 'scroll', sync);
.panel-heading .chevron:after {
    content: "\f078";   
}
.panel-heading.collapsed .chevron:after {
    content: "\f054"; 
}

#generalContainer, #dataContainer{
  width: 1050px;
  height: 300px; 
  overflow: auto;
}
.panel-body{
  font-size: 7pt;
  white-space:nowrap;
}
#generalContainer{
  
}

#dataContainer{
  
}

.general-head-col-width{
  width: 200px;
  padding: 5px 10px 10px 5px;
}

.general-col-width{
  width: 620px;
  padding: 5px 10px 10px 5px;
}
<link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.6.3/css/font-awesome.css" rel="stylesheet"/>
<link href="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.3.6/css/bootstrap.css" rel="stylesheet"/>

<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.3.6/js/bootstrap.js"></script>

<div id="generalContainer" >

<div class="panel panel-primary">
 <div class="panel-heading clearfix" data-toggle="collapse" data-target="#generalInfo"> General <i class="chevron fa fa-fw"></i></div>
	<div class="panel-body" id="generalInfo">
		<table>
			<tbody>
				<tr>
				<td class="general-head-col-width" ><span class="Caption">Number</span></td>
				<td class="general-col-width"><span>00110027</span></td>
				<td class="general-col-width"><span>00110032</span></td>
				<td class="general-col-width"><span>00110046</span></td>
				<td class="general-col-width"><span>00110046</span></td>
				<td class="general-col-width"><span>00110046</span></td>
				<td class="general-col-width"><span>00110046</span></td>
				<td class="general-col-width"><span>00110051</span></td>
				<td class="general-col-width"><span>00110051</span></td>
				<td class="general-col-width"><span>00110051</span></td>
				<td class="general-col-width"><span>00110126</span></td>
				<td class="general-col-width"><span>00110126</span></td>
				<td class="general-col-width"><span>00110131</span></td></tr>
				<tr>
				<td class="general-head-col-width" ><span class="Caption">Type</span></td>
				<td class="general-col-width"><span>ABC</span></td>
				<td class="general-col-width"><span>ABC</span></td>
				<td class="general-col-width"><span>ABC</span></td>
				<td class="general-col-width"><span>ABC</span></td>
				<td class="general-col-width"><span>ABC</span></td>
				<td class="general-col-width"><span>ABC</span></td>
				<td class="general-col-width"><span>ABC</span></td>
				<td class="general-col-width"><span>ABC</span></td>
				<td class="general-col-width"><span>ABC</span></td>
				<td class="general-col-width"><span>ABC</span></td>
				<td class="general-col-width"><span>ABC</span></td>
				<td class="general-col-width"><span>ABC</span></td>
				</tr>
				<tr>
				<td class="general-head-col-width" ><span class="Caption">Name</span></td>
				<td class="general-col-width"><span>This is a sample item.</span></td>
				<td class="general-col-width"><span>This is a sample item. This is a sample item.</span></td>
				<td class="general-col-width"><span>This is a sample item. This is a sample item. This is a sample item.</span></td>
				<td class="general-col-width"><span>This is a sample item. This is a sample item. This is a sample item.</span></td>
				<td class="general-col-width"><span>This is a sample item. This is a sample item. This is a sample item. This is a sample item.</span></td>
				<td class="general-col-width"><span>This is a sample item. This is a sample item. This is a sample item.</span></td>
				<td class="general-col-width"><span>This is a sample item. This is a sample item.</span></td>
				<td class="general-col-width"><span>This is a sample item.</span></td>
				<td class="general-col-width"><span>This is a sample item.</span></td>
				<td class="general-col-width"><span>This is a sample item. This is a sample item.</span></td>
				<td class="general-col-width"><span>This is a sample item. This is a sample item. This is a sample item. This is a sample item.</span></td>
				<td class="general-col-width"><span>This is a sample item. This is a sample item. This is a sample item.</span></td>
				<tr>
				<td class="general-head-col-width" ><span class="Caption">PA</span></td>
				<td class="general-col-width"><span>1413-Ovenware</span></td>
				<td class="general-col-width"><span>1511-Dinnerware and serving</span></td>
				<td class="general-col-width"><span>1521-Drinking glasses</span></td>
				<td class="general-col-width"><span>1521-Drinking glasses</span></td>
				<td class="general-col-width"><span>1521-Drinking glasses</span></td>
				<td class="general-col-width"><span>1521-Drinking glasses</span></td>
				<td class="general-col-width"><span>0821-Chairs incl covers, folding chairs and benches</span></td>
				<td class="general-col-width"><span>0821-Chairs incl covers, folding chairs and benches</span></td>
				<td class="general-col-width"><span>0821-Chairs incl covers, folding chairs and benches</span></td>
				<td class="general-col-width"><span>1711-Outdoor dining tables</span></td>
				<td class="general-col-width"><span>1711-Outdoor dining tables</span></td>
				<td class="general-col-width"><span>0934-Textiles for small children</span></td>
				</tr>
				<tr>
				<td class="general-head-col-width" ><span class="Caption">Another Option</span></td>
				<td class="general-col-width"><span>No</span></td>
				<td class="general-col-width"><span>No</span></td>
				<td class="general-col-width"><span>No</span></td>
				<td class="general-col-width"><span>No</span></td>
				<td class="general-col-width"><span>No</span></td>
				<td class="general-col-width"><span>No</span></td>
				<td class="general-col-width"><span>No</span></td>
				<td class="general-col-width"><span>No</span></td>
				<td class="general-col-width"><span>No</span></td>
				<td class="general-col-width"><span>No</span></td>
				<td class="general-col-width"><span>No</span></td>
				<td class="general-col-width"><span>No</span></td>
				</tr>
				<tr>
				<td class="general-head-col-width" ><span class="Caption">Supplier</span></td>
				<td class="general-col-width"><span>-</span></td>
				<td class="general-col-width"><span>-</span></td>
				<td class="general-col-width"><span>-</span></td>
				<td class="general-col-width"><span>-</span></td>
				<td class="general-col-width"><span>-</span></td>
				<td class="general-col-width"><span>20774-OOO Xxxxxx</span></td>
				<td class="general-col-width"><span>-</span></td>
				<td class="general-col-width"><span>-</span></td>
				<td class="general-col-width"><span>-</span></td>
				<td class="general-col-width"><span>-</span></td>
				<td class="general-col-width"><span>17987-Xxxxx. ABCDEF ghi</span></td>
				<td class="general-col-width"><span>-</span></td>
				</tr>
				<tr>
				<td class="general-head-col-width" ><span class="Caption">Type1</span></td>
				<td class="general-col-width"><span>Immediate</span></td>
				<td class="general-col-width"><span>Immediate</span></td>
				<td class="general-col-width"><span>Immediate</span></td>
				<td class="general-col-width"><span>Immediate</span></td>
				<td class="general-col-width"><span>Immediate</span></td>
				<td class="general-col-width"><span>Final</span></td>
				<td class="general-col-width"><span>Immediate</span></td>
				<td class="general-col-width"><span>Immediate</span></td>
				<td class="general-col-width"><span>Immediate</span></td>
				<td class="general-col-width"><span>Immediate</span></td>
				<td class="general-col-width"><span>Final</span></td>
				<td class="general-col-width"><span>Immediate</span></td>
				</tr>
				<tr>
				<td class="general-head-col-width" ><span class="Caption">Status</span></td>
				<td class="general-col-width"><span>INTERMEDIATE</span></td>
				<td class="general-col-width"><span>COMPLETED</span></td>
				<td class="general-col-width"><span>COMPLETED</span></td>
				<td class="general-col-width"><span>COMPLETED</span></td>
				<td class="general-col-width"><span>COMPLETED</span></td>
				<td class="general-col-width"><span>COMPLETED</span></td>
				<td class="general-col-width"><span>COMPLETED</span></td>
				<td class="general-col-width"><span>INTERMEDIATE</span></td>
				<td class="general-col-width"><span>INTERMEDIATE</span></td>
				<td class="general-col-width"><span>COMPLETED</span></td>
				<td class="general-col-width"><span>COMPLETED</span></td>
				<td class="general-col-width"><span>COMPLETED</span></td>
				</tr>
				<tr>
				<td class="general-head-col-width" ><span class="Caption">Date</span></td>
				<td class="general-col-width"><span>2009-10-02</span></td>
				<td class="general-col-width"><span>2011-02-11</span></td>
				<td class="general-col-width"><span>2016-01-15</span></td>
				<td class="general-col-width"><span>2016-01-15</span></td>
				<td class="general-col-width"><span>2009-11-24</span></td>
				<td class="general-col-width"><span>2016-02-27</span></td>
				<td class="general-col-width"><span>2009-11-03</span></td>
				<td class="general-col-width"><span>2009-10-02</span></td>
				<td class="general-col-width"><span>2009-10-02</span></td>
				<td class="general-col-width"><span>2013-10-18</span></td>
				<td class="general-col-width"><span>2015-04-13</span></td>
				<td class="general-col-width"><span>2009-10-02</span></td>
				</tr>
				<tr>
				<td class="general-head-col-width" ><span class="Caption">Latest Update</span></td>
				<td class="general-col-width"><span>2015-10-27</span></td>
				<td class="general-col-width"><span>2015-06-09</span></td>
				<td class="general-col-width"><span>2016-01-15</span></td>
				<td class="general-col-width"><span>2016-01-15</span></td>
				<td class="general-col-width"><span>2015-12-17</span></td>
				<td class="general-col-width"><span>2016-02-27</span></td>
				<td class="general-col-width"><span>2015-06-09</span></td>
				<td class="general-col-width"><span>2015-10-27</span></td>
				<td class="general-col-width"><span>2015-10-27</span></td>
				<td class="general-col-width"><span>2015-10-30</span></td>
				<td class="general-col-width"><span>2015-04-13</span></td>
				<td class="general-col-width"><span>2015-06-09</span></td>
				</tr>
				<tr>
				<td class="general-head-col-width" ><span class="Caption">No</span></td>
				<td class="general-col-width"><span>1</span></td>
				<td class="general-col-width"><span>1</span></td>
				<td class="general-col-width"><span>5</span></td>
				<td class="general-col-width"><span>4</span></td>
				<td class="general-col-width"><span>2</span></td>
				<td class="general-col-width"><span>5</span></td>
				<td class="general-col-width"><span>3</span></td>
				<td class="general-col-width"><span>2</span></td>
				<td class="general-col-width"><span>1</span></td>
				<td class="general-col-width"><span>1</span></td>
				<td class="general-col-width"><span>1</span></td>
				<td class="general-col-width"><span>1</span></td>
				</tr>
				<tr>
				<td class="general-head-col-width" ><span class="Caption">Edition</span></td>
				<td class="general-col-width"><span>1</span></td>
				<td class="general-col-width"><span>3</span></td>
				<td class="general-col-width"><span>2</span></td>
				<td class="general-col-width"><span>3</span></td>
				<td class="general-col-width"><span>4</span></td>
				<td class="general-col-width"><span>2</span></td>
				<td class="general-col-width"><span>1</span></td>
				<td class="general-col-width"><span>1</span></td>
				<td class="general-col-width"><span>1</span></td>
				<td class="general-col-width"><span>6</span></td>
				<td class="general-col-width"><span>6</span></td>
				<td class="general-col-width"><span>1</span></td>
				</tr>
				<tr>
				<td class="general-head-col-width" ><span class="Caption">Validity</span></td>
				<td class="general-col-width"><span>-</span></td>
				<td class="general-col-width"><span>-</span></td>
				<td class="general-col-width"><span>-</span></td>
				<td class="general-col-width"><span>-</span></td>
				<td class="general-col-width"><span>-</span></td>
				<td class="general-col-width"><span>2016-02-28-</span></td>
				<td class="general-col-width"><span>-</span></td>
				<td class="general-col-width"><span>-</span></td>
				<td class="general-col-width"><span>-</span></td>
				<td class="general-col-width"><span>-</span></td>
				<td class="general-col-width"><span>2015-04-14-</span></td>
				<td class="general-col-width"><span>-</span></td></tr>
				<tr>
				<td class="general-head-col-width" ><span class="Caption">Date1</span></td>
				<td class="general-col-width"><span>-</span></td>
				<td class="general-col-width"><span>-</span></td>
				<td class="general-col-width"><span>-</span></td>
				<td class="general-col-width"><span>-</span></td>
				<td class="general-col-width"><span>-</span></td>
				<td class="general-col-width"><span>2016-02-27</span></td>
				<td class="general-col-width"><span>-</span></td>
				<td class="general-col-width"><span>-</span></td>
				<td class="general-col-width"><span>-</span></td>
				<td class="general-col-width"><span>-</span></td>
				<td class="general-col-width"><span>2015-04-13</span></td>
				<td class="general-col-width"><span>-</span></td></tr>
			</tbody>
		</table>
	</div>
</div>

</div>

<div id="dataContainer">

	<div class="panel panel-info">
		<div class="panel-heading collapsed" data-toggle="collapse" data-target="#RequiredCP">Package <i class="chevron fa fa-fw"></i></div>
			<div class="panel-body collapse" id="RequiredCP">                                
			<table>
			<tbody>
				<tr>
				<td class="general-head-col-width" ><span class="Caption">Number</span></td>
				<td class="general-col-width"><span>00110027</span></td>
				<td class="general-col-width"><span>00110032</span></td>
				<td class="general-col-width"><span>00110046</span></td>
				<td class="general-col-width"><span>00110046</span></td>
				<td class="general-col-width"><span>00110046</span></td>
				<td class="general-col-width"><span>00110046</span></td>
				<td class="general-col-width"><span>00110051</span></td>
				<td class="general-col-width"><span>00110051</span></td>
				<td class="general-col-width"><span>00110051</span></td>
				<td class="general-col-width"><span>00110126</span></td>
				<td class="general-col-width"><span>00110126</span></td>
				<td class="general-col-width"><span>00110131</span></td></tr>
				<tr>
				<td class="general-head-col-width" ><span class="Caption">Type</span></td>
				<td class="general-col-width"><span>ABC</span></td>
				<td class="general-col-width"><span>ABC</span></td>
				<td class="general-col-width"><span>ABC</span></td>
				<td class="general-col-width"><span>ABC</span></td>
				<td class="general-col-width"><span>ABC</span></td>
				<td class="general-col-width"><span>ABC</span></td>
				<td class="general-col-width"><span>ABC</span></td>
				<td class="general-col-width"><span>ABC</span></td>
				<td class="general-col-width"><span>ABC</span></td>
				<td class="general-col-width"><span>ABC</span></td>
				<td class="general-col-width"><span>ABC</span></td>
				<td class="general-col-width"><span>ABC</span></td>
				</tr>
				<tr>
				<td class="general-head-col-width" ><span class="Caption">Name</span></td>
				<td class="general-col-width"><span>This is a sample item.</span></td>
				<td class="general-col-width"><span>This is a sample item. This is a sample item.</span></td>
				<td class="general-col-width"><span>This is a sample item. This is a sample item. This is a sample item.</span></td>
				<td class="general-col-width"><span>This is a sample item. This is a sample item. This is a sample item.</span></td>
				<td class="general-col-width"><span>This is a sample item. This is a sample item. This is a sample item. This is a sample item.</span></td>
				<td class="general-col-width"><span>This is a sample item. This is a sample item. This is a sample item.</span></td>
				<td class="general-col-width"><span>This is a sample item. This is a sample item.</span></td>
				<td class="general-col-width"><span>This is a sample item.</span></td>
				<td class="general-col-width"><span>This is a sample item.</span></td>
				<td class="general-col-width"><span>This is a sample item. This is a sample item.</span></td>
				<td class="general-col-width"><span>This is a sample item. This is a sample item. This is a sample item. This is a sample item.</span></td>
				<td class="general-col-width"><span>This is a sample item. This is a sample item. This is a sample item.</span></td>
				<tr>
				<td class="general-head-col-width" ><span class="Caption">PA</span></td>
				<td class="general-col-width"><span>1413-Ovenware</span></td>
				<td class="general-col-width"><span>1511-Dinnerware and serving</span></td>
				<td class="general-col-width"><span>1521-Drinking glasses</span></td>
				<td class="general-col-width"><span>1521-Drinking glasses</span></td>
				<td class="general-col-width"><span>1521-Drinking glasses</span></td>
				<td class="general-col-width"><span>1521-Drinking glasses</span></td>
				<td class="general-col-width"><span>0821-Chairs incl covers, folding chairs and benches</span></td>
				<td class="general-col-width"><span>0821-Chairs incl covers, folding chairs and benches</span></td>
				<td class="general-col-width"><span>0821-Chairs incl covers, folding chairs and benches</span></td>
				<td class="general-col-width"><span>1711-Outdoor dining tables</span></td>
				<td class="general-col-width"><span>1711-Outdoor dining tables</span></td>
				<td class="general-col-width"><span>0934-Textiles for small children</span></td>
				</tr>
				<tr>
				<td class="general-head-col-width" ><span class="Caption">Another Option</span></td>
				<td class="general-col-width"><span>No</span></td>
				<td class="general-col-width"><span>No</span></td>
				<td class="general-col-width"><span>No</span></td>
				<td class="general-col-width"><span>No</span></td>
				<td class="general-col-width"><span>No</span></td>
				<td class="general-col-width"><span>No</span></td>
				<td class="general-col-width"><span>No</span></td>
				<td class="general-col-width"><span>No</span></td>
				<td class="general-col-width"><span>No</span></td>
				<td class="general-col-width"><span>No</span></td>
				<td class="general-col-width"><span>No</span></td>
				<td class="general-col-width"><span>No</span></td>
				</tr>
				<tr>
				<td class="general-head-col-width" ><span class="Caption">Supplier</span></td>
				<td class="general-col-width"><span>-</span></td>
				<td class="general-col-width"><span>-</span></td>
				<td class="general-col-width"><span>-</span></td>
				<td class="general-col-width"><span>-</span></td>
				<td class="general-col-width"><span>-</span></td>
				<td class="general-col-width"><span>20774-OOO Xxxxxx</span></td>
				<td class="general-col-width"><span>-</span></td>
				<td class="general-col-width"><span>-</span></td>
				<td class="general-col-width"><span>-</span></td>
				<td class="general-col-width"><span>-</span></td>
				<td class="general-col-width"><span>17987-Xxxxx. ABCDEF ghi</span></td>
				<td class="general-col-width"><span>-</span></td>
				</tr>
				<tr>
				<td class="general-head-col-width" ><span class="Caption">Type1</span></td>
				<td class="general-col-width"><span>Immediate</span></td>
				<td class="general-col-width"><span>Immediate</span></td>
				<td class="general-col-width"><span>Immediate</span></td>
				<td class="general-col-width"><span>Immediate</span></td>
				<td class="general-col-width"><span>Immediate</span></td>
				<td class="general-col-width"><span>Final</span></td>
				<td class="general-col-width"><span>Immediate</span></td>
				<td class="general-col-width"><span>Immediate</span></td>
				<td class="general-col-width"><span>Immediate</span></td>
				<td class="general-col-width"><span>Immediate</span></td>
				<td class="general-col-width"><span>Final</span></td>
				<td class="general-col-width"><span>Immediate</span></td>
				</tr>
				<tr>
				<td class="general-head-col-width" ><span class="Caption">Status</span></td>
				<td class="general-col-width"><span>INTERMEDIATE</span></td>
				<td class="general-col-width"><span>COMPLETED</span></td>
				<td class="general-col-width"><span>COMPLETED</span></td>
				<td class="general-col-width"><span>COMPLETED</span></td>
				<td class="general-col-width"><span>COMPLETED</span></td>
				<td class="general-col-width"><span>COMPLETED</span></td>
				<td class="general-col-width"><span>COMPLETED</span></td>
				<td class="general-col-width"><span>INTERMEDIATE</span></td>
				<td class="general-col-width"><span>INTERMEDIATE</span></td>
				<td class="general-col-width"><span>COMPLETED</span></td>
				<td class="general-col-width"><span>COMPLETED</span></td>
				<td class="general-col-width"><span>COMPLETED</span></td>
				</tr>
				<tr>
				<td class="general-head-col-width" ><span class="Caption">Date</span></td>
				<td class="general-col-width"><span>2009-10-02</span></td>
				<td class="general-col-width"><span>2011-02-11</span></td>
				<td class="general-col-width"><span>2016-01-15</span></td>
				<td class="general-col-width"><span>2016-01-15</span></td>
				<td class="general-col-width"><span>2009-11-24</span></td>
				<td class="general-col-width"><span>2016-02-27</span></td>
				<td class="general-col-width"><span>2009-11-03</span></td>
				<td class="general-col-width"><span>2009-10-02</span></td>
				<td class="general-col-width"><span>2009-10-02</span></td>
				<td class="general-col-width"><span>2013-10-18</span></td>
				<td class="general-col-width"><span>2015-04-13</span></td>
				<td class="general-col-width"><span>2009-10-02</span></td>
				</tr>
				<tr>
				<td class="general-head-col-width" ><span class="Caption">Latest Update</span></td>
				<td class="general-col-width"><span>2015-10-27</span></td>
				<td class="general-col-width"><span>2015-06-09</span></td>
				<td class="general-col-width"><span>2016-01-15</span></td>
				<td class="general-col-width"><span>2016-01-15</span></td>
				<td class="general-col-width"><span>2015-12-17</span></td>
				<td class="general-col-width"><span>2016-02-27</span></td>
				<td class="general-col-width"><span>2015-06-09</span></td>
				<td class="general-col-width"><span>2015-10-27</span></td>
				<td class="general-col-width"><span>2015-10-27</span></td>
				<td class="general-col-width"><span>2015-10-30</span></td>
				<td class="general-col-width"><span>2015-04-13</span></td>
				<td class="general-col-width"><span>2015-06-09</span></td>
				</tr>
				<tr>
				<td class="general-head-col-width" ><span class="Caption">No</span></td>
				<td class="general-col-width"><span>1</span></td>
				<td class="general-col-width"><span>1</span></td>
				<td class="general-col-width"><span>5</span></td>
				<td class="general-col-width"><span>4</span></td>
				<td class="general-col-width"><span>2</span></td>
				<td class="general-col-width"><span>5</span></td>
				<td class="general-col-width"><span>3</span></td>
				<td class="general-col-width"><span>2</span></td>
				<td class="general-col-width"><span>1</span></td>
				<td class="general-col-width"><span>1</span></td>
				<td class="general-col-width"><span>1</span></td>
				<td class="general-col-width"><span>1</span></td>
				</tr>
				<tr>
				<td class="general-head-col-width" ><span class="Caption">Edition</span></td>
				<td class="general-col-width"><span>1</span></td>
				<td class="general-col-width"><span>3</span></td>
				<td class="general-col-width"><span>2</span></td>
				<td class="general-col-width"><span>3</span></td>
				<td class="general-col-width"><span>4</span></td>
				<td class="general-col-width"><span>2</span></td>
				<td class="general-col-width"><span>1</span></td>
				<td class="general-col-width"><span>1</span></td>
				<td class="general-col-width"><span>1</span></td>
				<td class="general-col-width"><span>6</span></td>
				<td class="general-col-width"><span>6</span></td>
				<td class="general-col-width"><span>1</span></td>
				</tr>
				<tr>
				<td class="general-head-col-width" ><span class="Caption">Validity</span></td>
				<td class="general-col-width"><span>-</span></td>
				<td class="general-col-width"><span>-</span></td>
				<td class="general-col-width"><span>-</span></td>
				<td class="general-col-width"><span>-</span></td>
				<td class="general-col-width"><span>-</span></td>
				<td class="general-col-width"><span>2016-02-28-</span></td>
				<td class="general-col-width"><span>-</span></td>
				<td class="general-col-width"><span>-</span></td>
				<td class="general-col-width"><span>-</span></td>
				<td class="general-col-width"><span>-</span></td>
				<td class="general-col-width"><span>2015-04-14-</span></td>
				<td class="general-col-width"><span>-</span></td></tr>
				<tr>
				<td class="general-head-col-width" ><span class="Caption">Date1</span></td>
				<td class="general-col-width"><span>-</span></td>
				<td class="general-col-width"><span>-</span></td>
				<td class="general-col-width"><span>-</span></td>
				<td class="general-col-width"><span>-</span></td>
				<td class="general-col-width"><span>-</span></td>
				<td class="general-col-width"><span>2016-02-27</span></td>
				<td class="general-col-width"><span>-</span></td>
				<td class="general-col-width"><span>-</span></td>
				<td class="general-col-width"><span>-</span></td>
				<td class="general-col-width"><span>-</span></td>
				<td class="general-col-width"><span>2015-04-13</span></td>
				<td class="general-col-width"><span>-</span></td></tr>
			</tbody>
		</table>
		</div>
	</div>
                           
</div>

2 个答案:

答案 0 :(得分:0)

使用解决方案更新:

将显示内联块添加到.panel和min-width以匹配您的容器。

.panel {
  display: inline-block;
  min-width: 1050px;
}

答案 1 :(得分:0)

您可以使用jQuery:

var collapse = $('.collapse')
collapse.css({ position: "absolute", visibility: "hidden", display: "block" });
$('table').each(function () {
  $(this).closest('.panel').css('width', $(this).width() + 30).find('.panel-heading').css('width', $(this).width() + 30);
});
collapse.css({ position: "", visibility: "", display: "" });

JSFiddle